mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
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:
commit
ca619cdf54
@ -28,6 +28,8 @@
|
|||||||
#include "get_bits.h"
|
#include "get_bits.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
|
#define PCX_HEADER_SIZE 128
|
||||||
|
|
||||||
static void pcx_rle_decode(GetByteContext *gb,
|
static void pcx_rle_decode(GetByteContext *gb,
|
||||||
uint8_t *dst,
|
uint8_t *dst,
|
||||||
unsigned int bytes_per_scanline,
|
unsigned int bytes_per_scanline,
|
||||||
@ -74,8 +76,10 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
bytes_per_scanline;
|
bytes_per_scanline;
|
||||||
uint8_t *ptr, *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;
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
bytestream2_init(&gb, avpkt->data, avpkt->size);
|
bytestream2_init(&gb, avpkt->data, avpkt->size);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user