[FFmpeg-cvslog] loco: check the last plane too
Michael Niedermayer
git at videolan.org
Sun Feb 24 13:09:17 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 24 13:03:13 2013 +0100| [33796645dc35511ff7419b96535ad05dd73ffde8] | committer: Michael Niedermayer
loco: check the last plane too
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33796645dc35511ff7419b96535ad05dd73ffde8
---
libavcodec/loco.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index 559f7c2..e21e693 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -240,10 +240,14 @@ static int decode_frame(AVCodecContext *avctx,
break;
}
+ if (decoded < 0 || decoded > buf_size)
+ goto buf_too_small;
+ buf_size -= decoded;
+
*got_frame = 1;
*(AVFrame*)data = l->pic;
- return buf_size < 0 ? -1 : avpkt->size - buf_size;
+ return avpkt->size - buf_size;
buf_too_small:
av_log(avctx, AV_LOG_ERROR, "Input data too small.\n");
return AVERROR(EINVAL);
More information about the ffmpeg-cvslog
mailing list