Browse Source

Merge commit 'ff07ec143ebd3833fd5a3f4b6c00474ac523a31f'

* commit 'ff07ec143ebd3833fd5a3f4b6c00474ac523a31f':
  pcx: Return an error on broken palette if err_detect is set to 'explode'

Conflicts:
	libavcodec/pcx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 11 years ago
parent
commit
bbe50a8001
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      libavcodec/pcx.c

+ 4
- 2
libavcodec/pcx.c View File

@@ -165,7 +165,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,


if (avpkt->size < 769) { if (avpkt->size < 769) {
av_log(avctx, AV_LOG_ERROR, "File is too short\n"); av_log(avctx, AV_LOG_ERROR, "File is too short\n");
ret = avpkt->size;
ret = avctx->err_recognition & AV_EF_EXPLODE ?
AVERROR_INVALIDDATA : avpkt->size;
goto end; goto end;
} }


@@ -180,7 +181,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
} }
if (bytestream2_get_byte(&gb) != 12) { if (bytestream2_get_byte(&gb) != 12) {
av_log(avctx, AV_LOG_ERROR, "expected palette after image data\n"); av_log(avctx, AV_LOG_ERROR, "expected palette after image data\n");
ret = avpkt->size;
ret = avctx->err_recognition & AV_EF_EXPLODE ?
AVERROR_INVALIDDATA : avpkt->size;
goto end; goto end;
} }
} else if (nplanes == 1) { /* all packed formats, max. 16 colors */ } else if (nplanes == 1) { /* all packed formats, max. 16 colors */


Loading…
Cancel
Save