Browse Source

bethsoftvid: check return value and clean memory

CC: libav-stable@libav.org
Bug-Id: CID 733777
tags/n2.5
Vittorio Giovara 10 years ago
parent
commit
e6c66f1e4e
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/bethsoftvid.c

+ 4
- 0
libavformat/bethsoftvid.c View File

@@ -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);
}


Loading…
Cancel
Save