diff options
author | Andreas Öman <andreas@olebyn.nu> | 2007-07-19 15:56:56 +0000 |
---|---|---|
committer | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2007-07-19 15:56:56 +0000 |
commit | 83c43e4d52dadc08c38f5f42bf6cdf1e2e72b11c (patch) | |
tree | 618b39b72ba38c9fa680dad721607a0e0c129520 | |
parent | 85565db0f8b85dc2bb2df2e788be1918eda3ed04 (diff) | |
download | ffmpeg-83c43e4d52dadc08c38f5f42bf6cdf1e2e72b11c.tar.gz |
bail out on unknown jpeg pixel format instead of silently decoding data incorrectly
patch by Andreas Öman % andreas A olebyn P nu %
Original thread:
date: Jul 19, 2007 4:50 PM
subject: [FFmpeg-devel] [PATCH] bail out on unknown jpeg pixel format
Originally committed as revision 9764 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/mjpegdec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index d65a3463cf..aa8d2e4f60 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -305,10 +305,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) case 0x221212: s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV422P : PIX_FMT_YUVJ422P; break; - default: case 0x221111: s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV420P : PIX_FMT_YUVJ420P; break; + default: + av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id); + return -1; } if(s->ls){ if(s->nb_components > 1) |