Commit c955bac7 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'd1d99e3b'

* commit 'd1d99e3b':
  pcx: Check the packet size before assuming it fits a palette
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 1eead877 d1d99e3b
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment