mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
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: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
65616bc191
commit
4f2ff3a53e
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user