diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-30 03:46:54 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-30 03:49:21 +0400 |
commit | c955bac7d5c1984dcb06539fe61844b7c09b72b4 (patch) | |
tree | b3030c93c37a26b2b85e10ab05dcc4035e9deac0 /libavcodec | |
parent | 1eead877669b04a7f029001bfea8c8c3fd46763d (diff) | |
parent | d1d99e3befea5d411ac3aae72dbdecce94f8b547 (diff) |
Merge commit 'd1d99e3befea5d411ac3aae72dbdecce94f8b547'
* commit 'd1d99e3befea5d411ac3aae72dbdecce94f8b547':
pcx: Check the packet size before assuming it fits a palette
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pcx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index d8b69b3b30..d024e4cd90 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -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); |