[FFmpeg-cvslog] bethsoftvid: check return value of av_packet_new_side_data()

Paul B Mahol git at videolan.org
Thu Oct 11 21:43:10 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Oct 11 19:37:25 2012 +0000| [3632f35c8e163f6aa6d63c317e3e1fca6a4a5fab] | committer: Paul B Mahol

bethsoftvid: check return value of av_packet_new_side_data()

Fixes null pointer dereference, fixes CID733777.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3632f35c8e163f6aa6d63c317e3e1fca6a4a5fab
---

 libavformat/bethsoftvid.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c
index 1a83c79..191f029 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);
     }
 



More information about the ffmpeg-cvslog mailing list