openbsd-ports/multimedia/libdv/patches/patch-libdv_dv_c
2009-03-06 20:04:56 +00:00

44 lines
1.5 KiB
Plaintext

$OpenBSD: patch-libdv_dv_c,v 1.4 2009/03/06 20:04:56 jasper Exp $
--- libdv/dv.c.orig Wed Oct 20 05:49:24 2004
+++ libdv/dv.c Mon Mar 2 21:59:07 2009
@@ -67,8 +67,12 @@
#define DV_MB420_YUV_MMX(a,b,c,d,e) dv_mb420_YUY2_mmx(a,b,c,d,e)
#endif
+#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
+#endif
+#ifndef MAX
#define MAX(a,b) ((a)<(b)?(b):(a))
+#endif
int dv_use_mmx;
@@ -798,7 +802,7 @@ dv_get_timestamp (dv_decoder_t *dv, char *tstptr)
int id;
if ((id = dv -> ssyb_pack [0x13]) != 0xff) {
- sprintf (tstptr,
+ snprintf (tstptr, 128,
"%02d:%02d:%02d.%02d",
((dv -> ssyb_data [id] [3] >> 4) & 0x03) * 10 +
(dv -> ssyb_data [id] [3] & 0x0f),
@@ -853,7 +857,7 @@ dv_get_recording_datetime (dv_decoder_t *dv, char *dtp
year = dv -> ssyb_data [id1] [3];
year = (year & 0x0f) + 10 * ((year >> 4) & 0x0f);
year += (year < 25) ? 2000 : 1900;
- sprintf (dtptr,
+ snprintf (dtptr, 128,
"%04d-%02d-%02d %02d:%02d:%02d",
year,
((dv -> ssyb_data [id1] [2] >> 4) & 0x01) * 10 +
@@ -875,7 +879,7 @@ dv_get_recording_datetime (dv_decoder_t *dv, char *dtp
year = dv -> vaux_data [id1] [3];
year = (year & 0x0f) + 10 * ((year >> 4) & 0x0f);
year += (year < 25) ? 2000 : 1900;
- sprintf (dtptr,
+ snprintf (dtptr, 128,
"%04d-%02d-%02d %02d:%02d:%02d",
year,
((dv -> vaux_data [id1] [2] >> 4) & 0x01) * 10 +