summaryrefslogtreecommitdiff
path: root/libavcodec/smacker.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-20 18:07:30 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-20 18:31:42 +0100
commitb07a5e9b6be902b70f536d9dce0dea45f48bc8d4 (patch)
tree0e14c1848342f930fa7b41d4ca46fa15a76fc8d1 /libavcodec/smacker.c
parent632fdec9f4eb80dc8301cb938bce4b470fed0c11 (diff)
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@gmx.at>
Diffstat (limited to 'libavcodec/smacker.c')
-rw-r--r--libavcodec/smacker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 717e9ea033..cd342b9d88 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);
}