[FFmpeg-cvslog] avcodec/rawdec: check for side data before checking its size

James Almer git at videolan.org
Mon Dec 5 19:57:46 EET 2016


ffmpeg | branch: release/3.1 | James Almer <jamrial at gmail.com> | Thu Nov  3 22:34:58 2016 -0300| [a1d9c17368706e8a6293782b70dc7398a72b842a] | committer: James Almer

avcodec/rawdec: check for side data before checking its size

Fixes valgrind warnings about usage of uninitialized values.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit 51e329918dc1826de7451541cb15bef3b9bfe138)

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

 libavcodec/rawdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 2d348da..ca0927c 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -369,7 +369,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
                                                      &pal_size);
         int ret;
 
-        if (pal_size != AVPALETTE_SIZE) {
+        if (pal && pal_size != AVPALETTE_SIZE) {
             av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
             pal = NULL;
         }



More information about the ffmpeg-cvslog mailing list