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:
@ -187,6 +187,7 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt,
|
|||||||
if (vid->palette) {
|
if (vid->palette) {
|
||||||
uint8_t *pdata = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
|
uint8_t *pdata = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
|
||||||
BVID_PALETTE_SIZE);
|
BVID_PALETTE_SIZE);
|
||||||
|
if (pdata)
|
||||||
memcpy(pdata, vid->palette, BVID_PALETTE_SIZE);
|
memcpy(pdata, vid->palette, BVID_PALETTE_SIZE);
|
||||||
av_freep(&vid->palette);
|
av_freep(&vid->palette);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user