diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-10-11 19:37:25 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-10-11 19:40:27 +0000 |
commit | 3632f35c8e163f6aa6d63c317e3e1fca6a4a5fab (patch) | |
tree | 9f8d9ab17b16417ec49bfc2c1d72f18613d3ef44 /libavformat | |
parent | 313b40efbd63a2c6b9933519ba2b208f1031a9d0 (diff) | |
download | ffmpeg-3632f35c8e163f6aa6d63c317e3e1fca6a4a5fab.tar.gz |
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>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/bethsoftvid.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c index 1a83c797f7..191f02944e 100644 --- a/libavformat/bethsoftvid.c +++ b/libavformat/bethsoftvid.c @@ -187,7 +187,8 @@ 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); - memcpy(pdata, vid->palette, BVID_PALETTE_SIZE); + if (pdata) + memcpy(pdata, vid->palette, BVID_PALETTE_SIZE); av_freep(&vid->palette); } |