[FFmpeg-cvslog] avformat/smacker: check for format mismatch more completely

Michael Niedermayer git at videolan.org
Fri Dec 20 18:52:22 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec 20 18:07:30 2013 +0100| [b07a5e9b6be902b70f536d9dce0dea45f48bc8d4] | committer: Michael Niedermayer

avformat/smacker: check for format mismatch more completely

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f6e83322950_9769_wetlogo.smk
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 717e9ea..cd342b9 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -662,7 +662,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
         av_log(avctx, AV_LOG_ERROR, "channels mismatch\n");
         return AVERROR(EINVAL);
     }
-    if (bits && avctx->sample_fmt == AV_SAMPLE_FMT_U8) {
+    if (bits == (avctx->sample_fmt == AV_SAMPLE_FMT_U8)) {
         av_log(avctx, AV_LOG_ERROR, "sample format mismatch\n");
         return AVERROR(EINVAL);
     }



More information about the ffmpeg-cvslog mailing list