vaapih265dec: segfault when it starts to decode a delta frame
Submitted by James Stevenson
Link to original bug (#796513)
Description
vaapih265dec crashes with an assert failure if stream does not start on keyframe in the i965 driver.
gst-launch-1.0: gen9_mfd.c:649: gen9_hcpd_get_reference_picture_frame_id: Assertion `0' failed.
#0 0x00007f13ff38fe97 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007f13ff391801 in __GI_abort () at abort.c:79
#2 0x00007f13ff38139a in __assert_fail_base (fmt=0x7f13ff5087d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f13be775b4c "0", file=file@entry=0x7f13be46bdf0 "gen9_mfd.c", line=line@entry=649, function=function@entry=0x7f13be46c500 "gen9_hcpd_get_reference_picture_frame_id") at assert.c:92
#3 0x00007f13ff381412 in __GI___assert_fail (assertion=0x7f13be775b4c "0", file=0x7f13be46bdf0 "gen9_mfd.c", line=649, function=0x7f13be46c500 "gen9_hcpd_get_reference_picture_frame_id") at assert.c:101
#4 0x00007f13be334b41 in () at /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
#5 0x00007f13be33649b in () at /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
#6 0x00007f13d471c820 in vaEndPicture () at /usr/lib/x86_64-linux-gnu/libva.so.2
#7 0x00007f13f0507dd3 in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so
#8 0x00007f13f051fb5d in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so
#9 0x00007f13f04fa643 in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so
#10 0x00007f13f04dec52 in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so
#11 0x00007f13fbde4b81 in gst_video_decoder_decode_frame (decoder=decoder@entry=0x7f13c40761a0, frame=0x55dd7e987df0) at gstvideodecoder.c:3416
#12 0x00007f13fbded16f in gst_video_decoder_have_frame (decoder=0x7f13c40761a0) at gstvideodecoder.c:3348
#13 0x00007f13f04dd81a in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so
#14 0x00007f13fbde4d43 in gst_video_decoder_parse_available (dec=dec@entry=0x7f13c40761a0, at_eos=at_eos@entry=0, new_buffer=0, new_buffer@entry=1) at gstvideodecoder.c:882
#15 0x00007f13fbde770c in gst_video_decoder_chain_forward (decoder=decoder@entry=0x7f13c40761a0, buf=buf@entry=0x55dd7e987ce0, at_eos=at_eos@entry=0) at gstvideodecoder.c:2158
#16 0x00007f13fbde7d52 in gst_video_decoder_chain (pad=<optimised out>, parent=0x7f13c40761a0, buf=0x55dd7e987ce0) at gstvideodecoder.c:2456
#17 0x00007f13fff4146b in gst_pad_chain_data_unchecked (data=0x55dd7e987ce0, type=4112, pad=0x7f13c8024fa0) at gstpad.c:4279
#18 0x00007f13fff4146b in gst_pad_push_data (pad=pad@entry=0x55dd7e9b7b20, type=type@entry=4112, data=data@entry=0x55dd7e987ce0) at gstpad.c:4535
#19 0x00007f13fff497a3 in gst_pad_push (pad=pad@entry=0x55dd7e9b7b20, buffer=buffer@entry=0x55dd7e987ce0) at gstpad.c:4654
#20 0x00007f13fff2f91b in gst_proxy_pad_chain_default (pad=<optimised out>, parent=<optimised out>, buffer=0x55dd7e987ce0) at gstghostpad.c:127
#21 0x00007f13fff4146b in gst_pad_chain_data_unchecked (data=0x55dd7e987ce0, type=4112, pad=0x55dd7e9b3970) at gstpad.c:4279
#22 0x00007f13fff4146b in gst_pad_push_data (pad=pad@entry=0x7f13c8024d50, type=type@entry=4112, data=data@entry=0x55dd7e987ce0) at gstpad.c:4535
Example pipeline I am using. I the identity shows the first frame as a delta when the crash happens. However if the first frame is a keyframe it will work correctly deocde and play video.
GST_DEBUG=3 gst-launch-1.0 -v rtspsrc location= ! rtph265depay ! h265parse ! identity silent=false ! decodebin ! videoconvert ! xvimagesink
Should the parser not drop data from the stream until a keyframe has passed? I also tried with "h265parse disable-passthrough=true" to try to enable this.
Same video source under both conditions (keyframe/delta as first frame) works fine with the avdec_h265 decoder.
Version: 1.14.0