avformat/oggdec: check for av_packet_new_side_data() failure
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Apr 2014 15:08:19 +0000 (17:08 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Apr 2014 16:10:47 +0000 (18:10 +0200)
Fixes CID1197062
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/oggdec.c

index fd18e99..b969537 100644 (file)
@@ -806,6 +806,11 @@ retry:
         uint8_t *side_data = av_packet_new_side_data(pkt,
                                                      AV_PKT_DATA_METADATA_UPDATE,
                                                      os->new_metadata_size);
+        if(side_data == NULL) {
+            av_free_packet(pkt);
+            av_free(pkt);
+            return AVERROR(ENOMEM);
+        }
         memcpy(side_data, os->new_metadata, os->new_metadata_size);
         av_freep(&os->new_metadata);
         os->new_metadata_size = 0;