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: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit c54a1565f512858ccfa70392f40f11c098bc1b63) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d94d383f13
commit
c27f2ea471
@ -1358,6 +1358,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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user