Merge commit '221402c1c88b9d12130c6f5834029b535ee0e0c5'

* commit '221402c1c88b9d12130c6f5834029b535ee0e0c5':
  pcx: check that the packet is large enough before reading the header

See 8cd1c0febe

Merged-by: Clément Bœsch <u@pkh.me>
This commit is contained in:
Clément Bœsch 2017-03-19 17:54:08 +01:00
commit ca619cdf54

View File

@ -28,6 +28,8 @@
#include "get_bits.h"
#include "internal.h"
#define PCX_HEADER_SIZE 128
static void pcx_rle_decode(GetByteContext *gb,
uint8_t *dst,
unsigned int bytes_per_scanline,
@ -74,8 +76,10 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
bytes_per_scanline;
uint8_t *ptr, *scanline;
if (avpkt->size < 128)
if (avpkt->size < PCX_HEADER_SIZE) {
av_log(avctx, AV_LOG_ERROR, "Packet too small\n");
return AVERROR_INVALIDDATA;
}
bytestream2_init(&gb, avpkt->data, avpkt->size);