Merge commit 'd1d99e3befea5d411ac3aae72dbdecce94f8b547'

* commit 'd1d99e3befea5d411ac3aae72dbdecce94f8b547':
  pcx: Check the packet size before assuming it fits a palette

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-30 01:46:54 +02:00
commit c955bac7d5

View File

@ -163,6 +163,12 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
} else if (nplanes == 1 && bits_per_pixel == 8) {
int palstart = avpkt->size - 769;
if (avpkt->size < 769) {
av_log(avctx, AV_LOG_ERROR, "File is too short\n");
ret = avpkt->size;
goto end;
}
for (y = 0; y < h; y++, ptr += stride) {
pcx_rle_decode(&gb, scanline, bytes_per_scanline, compressed);
memcpy(ptr, scanline, w);