avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr dereference
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Dec 2013 00:33:35 +0000 (01:33 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Dec 2013 01:09:20 +0000 (02:09 +0100)
Fixes CID1035715

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rtpenc.c

index 6fdc908..f010008 100644 (file)
@@ -557,6 +557,10 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
             const uint8_t *mb_info =
                 av_packet_get_side_data(pkt, AV_PKT_DATA_H263_MB_INFO,
                                         &mb_info_size);
+            if (!mb_info) {
+                av_log(s1, AV_LOG_ERROR, "failed to allocate side data\n");
+                return AVERROR(ENOMEM);
+            }
             ff_rtp_send_h263_rfc2190(s1, pkt->data, size, mb_info, mb_info_size);
             break;
         }