avformat/smacker: check for format mismatch more completely
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 20 Dec 2013 17:07:30 +0000 (18:07 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 20 Dec 2013 17:31:42 +0000 (18:31 +0100)
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@gmx.at>
libavcodec/smacker.c

index 717e9ea..cd342b9 100644 (file)
@@ -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);
     }