1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

bethsoftvid: check return value of av_packet_new_side_data()

Fixes null pointer dereference, fixes CID733777.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2012-10-11 19:37:25 +00:00
parent 313b40efbd
commit 3632f35c8e

View File

@ -187,7 +187,8 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt,
if (vid->palette) {
uint8_t *pdata = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
BVID_PALETTE_SIZE);
memcpy(pdata, vid->palette, BVID_PALETTE_SIZE);
if (pdata)
memcpy(pdata, vid->palette, BVID_PALETTE_SIZE);
av_freep(&vid->palette);
}