vaapi/mpeg2: segment fault when reverse playback
Submitted by Chenglin Ye
Link to original bug (#793981)
Description
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:
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;
1454 if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) {Version: 1.12.x