[FFmpeg-cvslog] avcodec/pngdec: fix () in OP_* macros
Michael Niedermayer
git at videolan.org
Sun May 25 19:35:51 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun May 25 19:24:30 2014 +0200| [c163f5e601ca2f948ef1050eafecc0ee4f0e58a6] | committer: Michael Niedermayer
avcodec/pngdec: fix () in OP_* macros
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c163f5e601ca2f948ef1050eafecc0ee4f0e58a6
---
libavcodec/pngdec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index fd771fc..c92087f 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -237,7 +237,7 @@ static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
*(int *)(dst + i) = p;
}
} else {
-#define OP_SUB(x, s, l) x + s
+#define OP_SUB(x, s, l) ((x) + (s))
UNROLL_FILTER(OP_SUB);
}
break;
@@ -249,7 +249,7 @@ static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
p = (last[i] >> 1);
dst[i] = p + src[i];
}
-#define OP_AVG(x, s, l) (((x + l) >> 1) + s) & 0xff
+#define OP_AVG(x, s, l) (((((x) + (l)) >> 1) + (s)) & 0xff)
UNROLL_FILTER(OP_AVG);
break;
case PNG_FILTER_VALUE_PAETH:
More information about the ffmpeg-cvslog
mailing list