diff --git a/libavformat/utils.c b/libavformat/utils.c index 0c40aa95d5..2c62d304c2 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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; } }