diff options
author | Peter Ross <pross@xvid.org> | 2012-03-12 10:32:11 +1100 |
---|---|---|
committer | Peter Ross <pross@xvid.org> | 2012-03-13 21:56:19 +1100 |
commit | e05253bf49e19c601c9d4a872c4f7f985797e163 (patch) | |
tree | fe13f9d55690ceb6b0c6e9ed0e938e9d53f1cbed /libavcodec | |
parent | b25a265a5c921d2d223a8aeff2f918894d515934 (diff) | |
download | ffmpeg-e05253bf49e19c601c9d4a872c4f7f985797e163.tar.gz |
iff: do not decode unsupported pbms with ham decoder
This prevents the segfault reported by ticket #1054
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/iff.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c index fdeba14fa7..925d92815a 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -638,12 +638,15 @@ static int decode_frame_byterun1(AVCodecContext *avctx, uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; buf += decode_byterun(row, avctx->width, buf, buf_end); } - } else { // IFF-PBM: HAM to PIX_FMT_BGR32 + } else if (s->ham) { // IFF-PBM: HAM to PIX_FMT_BGR32 for (y = 0; y < avctx->height ; y++) { uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; buf += decode_byterun(s->ham_buf, avctx->width, buf, buf_end); decode_ham_plane32((uint32_t *) row, s->ham_buf, s->ham_palbuf, s->planesize); } + } else { + av_log_ask_for_sample(avctx, "unsupported bpp\n"); + return AVERROR_INVALIDDATA; } } |