Module: libav Branch: master Commit: e6c66f1e4ea19a3aa6ed999c5cb92e1b682c7600
Author: Vittorio Giovara <[email protected]> Committer: Vittorio Giovara <[email protected]> Date: Fri Oct 24 13:15:34 2014 +0100 bethsoftvid: check return value and clean memory CC: [email protected] Bug-Id: CID 733777 --- libavformat/bethsoftvid.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c index 120e145..85abf25 100644 --- a/libavformat/bethsoftvid.c +++ b/libavformat/bethsoftvid.c @@ -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); } _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
