diff options
author | Dale Curtis <dalecurtis@chromium.org> | 2013-05-22 15:17:08 -0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-23 03:29:47 +0200 |
commit | c54a1565f512858ccfa70392f40f11c098bc1b63 (patch) | |
tree | 2f1ac2054d7f81994ba212017c60abb11261fc15 /libavformat/utils.c | |
parent | 1f02927d288cd2ef3ac8ce470c5901032d6faf34 (diff) | |
download | ffmpeg-c54a1565f512858ccfa70392f40f11c098bc1b63.tar.gz |
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>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; } } |