[FFmpeg-cvslog] avformat/utils: Keep internal and external av_read_frame() packets in sync.
Dale Curtis
git at videolan.org
Sun Aug 25 13:20:45 CEST 2013
ffmpeg | branch: release/0.11 | Dale Curtis <dalecurtis at chromium.org> | Wed May 22 15:17:08 2013 -0700| [c27f2ea4715c2d51f3d13317a119a56116036488] | committer: 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: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit c54a1565f512858ccfa70392f40f11c098bc1b63)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c27f2ea4715c2d51f3d13317a119a56116036488
---
libavformat/utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 28ffaaa..576f4aa 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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;
}
}
More information about the ffmpeg-cvslog
mailing list