diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-19 02:07:22 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-09-05 01:01:35 +0200 |
commit | 815a4439c38489cabf7554ba3c722c135a700db3 (patch) | |
tree | 9f94473d9ea2b0fe938e8607257bd8ecf4595a11 /libavcodec/rawdec.c | |
parent | 17035c8d2eb38d1e1c6adf7962e75dbd45e6351e (diff) | |
download | ffmpeg-815a4439c38489cabf7554ba3c722c135a700db3.tar.gz |
avcodec/rawdec: Fix bits_per_coded_sample checks
Fixes assertion failure
Fixes: 9eb9cf5b8c26dd0fa7107ed0348dcc1f/signal_sigabrt_7ffff6ae7c37_8926_4609a5c3f071d555d2d557625f9687b1.swf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 237207645b36fb79759d313c0399ee93ba467b9d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r-- | libavcodec/rawdec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 287be96955..193a88fd33 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -223,8 +223,9 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, } desc = av_pix_fmt_desc_get(avctx->pix_fmt); - if ((avctx->bits_per_coded_sample == 8 || avctx->bits_per_coded_sample == 4 - || avctx->bits_per_coded_sample <= 2) && + if ((avctx->bits_per_coded_sample == 8 || avctx->bits_per_coded_sample == 4 || + avctx->bits_per_coded_sample == 2 || avctx->bits_per_coded_sample == 1 || + (avctx->bits_per_coded_sample == 0 && (context->is_nut_pal8 || context->is_mono)) ) && (context->is_mono || context->is_pal8) && (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' ') || context->is_nut_mono || context->is_nut_pal8)) { |