mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
ext/ffmpeg/gstffmpegdec.c: Fix some segfaults while seeking. When i have unreffed the buffer in _release_buffer i sho...
Original commit message from CVS: * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_release_buffer), (gst_ffmpegdec_frame): Fix some segfaults while seeking. When i have unreffed the buffer in _release_buffer i should also set picture->opaque to NULL otherwise sometimes it can be unreffed another time in _frame causing an invalid read/write.
This commit is contained in:
parent
3ebe19c676
commit
e6ada24827
3 changed files with 23 additions and 7 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2005-11-16 Luca Ognibene <luogni@tin.it>
|
||||||
|
|
||||||
|
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_release_buffer),
|
||||||
|
(gst_ffmpegdec_frame):
|
||||||
|
Fix some segfaults while seeking. When i have unreffed
|
||||||
|
the buffer in _release_buffer i should also set picture->opaque to
|
||||||
|
NULL otherwise sometimes it can be unreffed another time in
|
||||||
|
_frame causing an invalid read/write.
|
||||||
|
|
||||||
2005-11-14 Andy Wingo <wingo@pobox.com>
|
2005-11-14 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
* configure.ac (GST_PLUGIN_LDFLAGS): -no-undefined for better
|
* configure.ac (GST_PLUGIN_LDFLAGS): -no-undefined for better
|
||||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit 657b549dfb640a76f3d7ab7676e453c801a83dca
|
Subproject commit ea1409191cc1e71273b2dbdd94e7ab5fc5a60a51
|
|
@ -603,16 +603,19 @@ static void
|
||||||
gst_ffmpegdec_release_buffer (AVCodecContext * context, AVFrame * picture)
|
gst_ffmpegdec_release_buffer (AVCodecContext * context, AVFrame * picture)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
GstBuffer *buf = GST_BUFFER (picture->opaque);
|
GstBuffer *buf;
|
||||||
GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) context->opaque;
|
GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) context->opaque;
|
||||||
|
|
||||||
|
|
||||||
g_return_if_fail (buf != NULL);
|
g_return_if_fail (buf != NULL);
|
||||||
g_return_if_fail (picture->type == FF_BUFFER_TYPE_USER);
|
g_return_if_fail (picture->type == FF_BUFFER_TYPE_USER);
|
||||||
|
|
||||||
|
buf = GST_BUFFER (picture->opaque);
|
||||||
|
|
||||||
if (buf == ffmpegdec->last_buffer)
|
if (buf == ffmpegdec->last_buffer)
|
||||||
ffmpegdec->last_buffer = NULL;
|
ffmpegdec->last_buffer = NULL;
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
|
|
||||||
|
picture->opaque = NULL;
|
||||||
|
|
||||||
/* zero out the reference in ffmpeg */
|
/* zero out the reference in ffmpeg */
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
|
@ -769,9 +772,13 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
|
||||||
"Dropping frame for synctime %" GST_TIME_FORMAT
|
"Dropping frame for synctime %" GST_TIME_FORMAT
|
||||||
", expected(next_ts) %" GST_TIME_FORMAT,
|
", expected(next_ts) %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (ffmpegdec->synctime),
|
GST_TIME_ARGS (ffmpegdec->synctime),
|
||||||
GST_TIME_ARGS (ffmpegdec->next_ts));
|
GST_TIME_ARGS (ffmpegdec->next_ts));
|
||||||
if (ffmpegdec->last_buffer)
|
|
||||||
gst_buffer_unref (ffmpegdec->last_buffer);
|
if (ffmpegdec->picture->opaque != NULL) {
|
||||||
|
outbuf = (GstBuffer *) ffmpegdec->picture->opaque;
|
||||||
|
gst_buffer_unref (outbuf);
|
||||||
|
}
|
||||||
|
|
||||||
have_data = 0;
|
have_data = 0;
|
||||||
/* don´t break here! Timestamps are updated below */
|
/* don´t break here! Timestamps are updated below */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue