[SCM] libav/experimental: oma: fix build if memcmp() is a macro

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:45:59 UTC 2013


The following commit has been merged in the experimental branch:
commit 78ad664a7e4960da0ecf501525a4121372df5662
Author: Måns Rullgård <mans at mansr.com>
Date:   Sat May 16 15:09:30 2009 +0000

    oma: fix build if memcmp() is a macro
    
    Any C library function may be a macro, so compound literals
    passed to memcmp() must be surrounded by parens to avoid being
    split on commas.
    
    Originally committed as revision 18856 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/oma.c b/libavformat/oma.c
index e82eeac..ecfb242 100644
--- a/libavformat/oma.c
+++ b/libavformat/oma.c
@@ -89,7 +89,7 @@ static int oma_read_header(AVFormatContext *s,
     if (ret != EA3_HEADER_SIZE)
         return -1;
 
-    if (memcmp(buf, (const uint8_t[]){'E', 'A', '3'},3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
+    if (memcmp(buf, ((const uint8_t[]){'E', 'A', '3'}),3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
         av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n");
         return -1;
     }
@@ -177,7 +177,7 @@ static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
 
 static int oma_read_probe(AVProbeData *p)
 {
-    if (!memcmp(p->buf, (const uint8_t[]){'e', 'a', '3', 3, 0},5))
+    if (!memcmp(p->buf, ((const uint8_t[]){'e', 'a', '3', 3, 0}),5))
         return AVPROBE_SCORE_MAX;
     else
         return 0;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list