Commit c54a1565 authored by Dale Curtis's avatar Dale Curtis Committed by Michael Niedermayer

avformat/utils: Keep internal and external av_read_frame() packets in sync.

Otherwise, during error conditions, the caller will be left with
dangling pointers to a destructed packet => boom.

BUG=242786
TEST=ffmpeg_regression_tests

Commit slightly simplified by commiter
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1f02927d
......@@ -1506,6 +1506,9 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
st->skip_to_keyframe = 0;
if (st->skip_to_keyframe) {
av_free_packet(&cur_pkt);
if (got_packet) {
*pkt = cur_pkt;
}
got_packet = 0;
}
}
......
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