aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rawdec.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-30 01:42:45 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-30 09:07:43 +0200
commit50fee0fc8b2540eade190575ab7802826597bf32 (patch)
tree120bd8173bfe61bee71fa51ddc06348d5526480c /libavcodec/rawdec.c
parente1197b9e1746c03b1d13d816d1569aeaf1b71ecc (diff)
downloadffmpeg-50fee0fc8b2540eade190575ab7802826597bf32.tar.gz
rawdec: fail in case of unknow pixel format
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r--libavcodec/rawdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index f8e119b017..503351e68a 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -97,6 +97,11 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
else if (avctx->pix_fmt == PIX_FMT_NONE && avctx->bits_per_coded_sample)
avctx->pix_fmt = ff_find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);
+ if (avctx->pix_fmt == PIX_FMT_NONE) {
+ av_log(avctx, AV_LOG_ERROR, "Pixel format was not specified and cannot be detected\n");
+ return AVERROR(EINVAL);
+ }
+
ff_set_systematic_pal2(context->palette, avctx->pix_fmt);
context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
if((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) &&