After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 793981 - vaapi/mpeg2: segment fault when reverse playback
vaapi/mpeg2: segment fault when reverse playback
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
1.12.x
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-03-02 07:58 UTC by Chenglin Ye
Modified: 2018-11-03 15:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libs: decoder: mpeg2: bail out if not enough data in buffer (1.40 KB, patch)
2018-03-03 15:53 UTC, Víctor Manuel Jáquez Leal
none Details | Review

Description Chenglin Ye 2018-03-02 07:58:48 UTC
I try rewind mpeg2 video(set playback rate to -1), however, segment fault caused at gstvaapidecoder_mpeg2.c:1461, traced by gdb, I found that packet.data value is 0x0. So, I think it is necessary to judge the value of packet.data before 1461, how do you think?
  Else, It was strange to me why packet.data was 0x0 when rewind, and it was a valid value when playback normally, Dose mpeg2 video not support rewinding?

souce code:
--------------------------------------------------------------------
1454  if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) {
1455    GST_ERROR ("failed to map buffer");
1456    return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;
1457  }
1458
1459  packet.data = map_info.data + unit->offset;
1460  packet.size = unit->size;
1461  packet.type = packet.data[3];
1462  packet.offset = 4;
--------------------------------------------------------------------
Comment 1 Víctor Manuel Jáquez Leal 2018-03-02 17:28:08 UTC
It seems that mpeg2 doesn't support reverse playaback. Even gst-libav fails (graciously) to play in reverse mpeg2. Even yet, mpeg2 containers refuse to play in reverse mode.

But I'm not sure were this, among the stack, should be fixed.
Comment 2 Víctor Manuel Jáquez Leal 2018-03-02 17:33:44 UTC
Looks like mpeg2 reverse playback is a hard problem

https://stackoverflow.com/questions/9392152/mpeg-backwards-frame-decoding-using-ffmpeg
Comment 3 Víctor Manuel Jáquez Leal 2018-03-03 15:53:49 UTC
Created attachment 369225 [details] [review]
libs: decoder: mpeg2: bail out if not enough data in buffer

Naive solution checking if there is enough data in the buffer to
decode. This happens when the containers wrongly permits reverse
playback of mpeg2 streams.
Comment 4 Chenglin Ye 2018-03-14 03:27:28 UTC
I got it.

Thanks for taking time to confirm this issue.
Comment 5 GStreamer system administrator 2018-11-03 15:53:36 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/87.