Nothing currently guarantees that the packet will be writtable.
Signed-off-by: James Almer <[email protected]>
---
libavcodec/mpeg4_unpack_bframes_bsf.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libavcodec/mpeg4_unpack_bframes_bsf.c
b/libavcodec/mpeg4_unpack_bframes_bsf.c
index ba970794c5..00cc35c2ab 100644
--- a/libavcodec/mpeg4_unpack_bframes_bsf.c
+++ b/libavcodec/mpeg4_unpack_bframes_bsf.c
@@ -149,8 +149,14 @@ static int mpeg4_unpack_bframes_filter(AVBSFContext *ctx,
AVPacket *out)
av_packet_move_ref(out, in);
out->size = pos_vop2;
} else if (pos_p >= 0) {
+ ret = av_new_packet(out, in->size);
+ if (ret < 0)
+ goto fail;
+ ret = av_packet_copy_props(out, in);
+ if (ret < 0)
+ goto fail;
+ memcpy(out->data, in->data, in->size);
av_log(ctx, AV_LOG_DEBUG, "Updating DivX userdata (remove trailing
'p').\n");
- av_packet_move_ref(out, in);
/* remove 'p' (packed) from the end of the (DivX) userdata string */
out->data[pos_p] = '\0';
} else {
--
2.16.2
_______________________________________________
ffmpeg-devel mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel