[FFmpeg-cvslog] avcodec/y41pdec: Avoid using float for size test
Michael Niedermayer
git at videolan.org
Sat May 23 21:55:08 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat May 23 21:27:10 2015 +0200| [de0d3fe562e25560d0fe4e2b6902e5878a2a63cc] | committer: Michael Niedermayer
avcodec/y41pdec: Avoid using float for size test
Floats are not bitexact
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de0d3fe562e25560d0fe4e2b6902e5878a2a63cc
---
libavcodec/y41pdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/y41pdec.c b/libavcodec/y41pdec.c
index 9d1e531..22c7d1f 100644
--- a/libavcodec/y41pdec.c
+++ b/libavcodec/y41pdec.c
@@ -43,7 +43,7 @@ static int y41p_decode_frame(AVCodecContext *avctx, void *data,
uint8_t *y, *u, *v;
int i, j, ret;
- if (avpkt->size < 1.5 * avctx->height * avctx->width) {
+ if (avpkt->size < 3LL * avctx->height * avctx->width / 2) {
av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n");
return AVERROR(EINVAL);
}
More information about the ffmpeg-cvslog
mailing list