Skip to content
Snippets Groups Projects
Commit e6c66f1e authored by Vittorio Giovara's avatar Vittorio Giovara
Browse files

bethsoftvid: check return value and clean memory

CC: libav-stable@libav.org
Bug-Id: CID 733777
parent b46b233b
Branches
Tags
No related merge requests found
......@@ -189,6 +189,10 @@ 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);
if (!pdata) {
ret = AVERROR(ENOMEM);
goto fail;
}
memcpy(pdata, vid->palette, BVID_PALETTE_SIZE);
av_freep(&vid->palette);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment