Browse Source

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>
tags/n3.3
Clément Bœsch 9 years ago
parent
commit
ca619cdf54
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavcodec/pcx.c

+ 5
- 1
libavcodec/pcx.c 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);



Loading…
Cancel
Save