[FFmpeg-cvslog] yopdec: check that palette fits in the packet

Michael Niedermayer git at videolan.org
Sat Jun 9 21:05:15 CEST 2012


ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Fri Jun  1 15:51:50 2012 +0200| [3c69368e6be17f9c99767f0d3e0c078b0ea976e8] | committer: Michael Niedermayer

yopdec: check that palette fits in the packet

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit b6fdf8dea7aaf3cb9a979dce91f752c2ce3086a3)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c69368e6be17f9c99767f0d3e0c078b0ea976e8
---

 libavcodec/yop.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/yop.c b/libavcodec/yop.c
index 55526c2..bf8a000 100644
--- a/libavcodec/yop.c
+++ b/libavcodec/yop.c
@@ -204,6 +204,11 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     if (s->frame.data[0])
         avctx->release_buffer(avctx, &s->frame);
 
+    if (avpkt->size < 4 + 3*s->num_pal_colors) {
+        av_log(avctx, AV_LOG_ERROR, "packet of size %d too small\n", avpkt->size);
+        return AVERROR_INVALIDDATA;
+    }
+
     ret = avctx->get_buffer(avctx, &s->frame);
     if (ret < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");



More information about the ffmpeg-cvslog mailing list