summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-13 00:27:21 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-13 00:51:29 +0200
commitdf037fe107ccfae4b26ee0e46b638b052f6e49f8 (patch)
tree15c9f5388a7f95c12fe505a39da932ab779c7372 /libavcodec
parente0db41316a94d85c1d6ab7ebeaf1f4b5e0f3c76a (diff)
downloadffmpeg-df037fe107ccfae4b26ee0e46b638b052f6e49f8.tar.gz
avcodec/smvjpegdec: assert that the pixel format that has been set by our decoder is valid
If we do check av_pix_fmt_desc_get() then we should fail and not continue with an invalid pix_fmt Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/smvjpegdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
index 45faff29fc..9c2fb380e1 100644
--- a/libavcodec/smvjpegdec.c
+++ b/libavcodec/smvjpegdec.c
@@ -164,7 +164,9 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_siz
return AVERROR(EINVAL);
desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
- if (desc && mjpeg_data->height % (s->frames_per_jpeg << desc->log2_chroma_h)) {
+ av_assert0(desc);
+
+ if (mjpeg_data->height % (s->frames_per_jpeg << desc->log2_chroma_h)) {
av_log(avctx, AV_LOG_ERROR, "Invalid height\n");
return AVERROR_INVALIDDATA;
}