Commit 4f2ff3a5 authored by James Almer's avatar James Almer

avcodec/mpeg4_unpack_bframes: make sure the packet is writable when data needs to be changed

Nothing currently guarantees that the packet passed to the bsf will
be writable.
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 65616bc1
......@@ -149,6 +149,9 @@ 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_packet_make_writable(in);
if (ret < 0)
goto fail;
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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment