aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-10-24 13:15:34 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-10-27 18:21:40 +0000
commite6c66f1e4ea19a3aa6ed999c5cb92e1b682c7600 (patch)
treebbc7ebb38b54f4e0fb9e0163e0d534df7a85528b
parentb46b233baffc2076a1a17a264ba9553ae0d4878f (diff)
downloadffmpeg-e6c66f1e4ea19a3aa6ed999c5cb92e1b682c7600.tar.gz
bethsoftvid: check return value and clean memory
CC: libav-stable@libav.org Bug-Id: CID 733777
-rw-r--r--libavformat/bethsoftvid.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c
index 120e145a76..85abf2515b 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);
}