avcodec/mpeg4_unpack_bframes_bsf: Check av_packet_from_data() return value
authorJan Sebechlebsky <sebechlebskyjan@gmail.com>
Fri, 22 Jul 2016 15:59:30 +0000 (17:59 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 22 Jul 2016 17:04:21 +0000 (19:04 +0200)
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mpeg4_unpack_bframes_bsf.c

index aee8ccb..e227f58 100644 (file)
@@ -126,7 +126,11 @@ static int mpeg4_unpack_bframes_filter(AVBSFContext *ctx, AVPacket *out)
             return ret;
         }
 
-        av_packet_from_data(out, s->b_frame_buf, s->b_frame_buf_size);
+        ret = av_packet_from_data(out, s->b_frame_buf, s->b_frame_buf_size);
+        if (ret < 0) {
+            av_packet_free(&in);
+            return ret;
+        }
         if (in->size <= MAX_NVOP_SIZE) {
             /* N-VOP */
             av_log(ctx, AV_LOG_DEBUG, "Skipping N-VOP.\n");