vah265dec: Decoder segfaults on seek
Using GStreamer 1.20.2, seeking on HEVC videos decoded with VA plugin causes SEGFAULT. Old vaapidecodebin
works fine. Both were tried on Intel GPU.
GDB says:
324 if (ref_va_pic->pic_order_cnt == picture->pic_order_cnt)
#0 _get_reference_index (picture=0x0, decoder=0x7fff6439ea60) at ../sys/va/gstvah265dec.c:324
ref_va_pic = 0x7fff6439f114
self = 0x7fff6439ea60
i = 0 '\000'
picture = 0x0
i = 0
#1 _fill_ref_pic_list.constprop.0
(decoder=decoder@entry=0x7fff6439ea60, va_reflist=va_reflist@entry=0x7fff6439f6a0 <error: Cannot access memory at address 0x7fff6439f6a0>, reflist=0x7fff88027180,
reflist@entry=<error reading variable: Cannot access memory at address 0x7fff795f8ea8>, cur_pic=<optimized out>) at ../sys/va/gstvah265dec.c:341
picture = 0x0
i = 0
#2 0x00007fff9003c623 in gst_va_h265_dec_decode_slice
(decoder=0x7fff6439ea60, picture=<optimized out>, slice=0x7fff6439dc08, ref_pic_list0=<optimized out>, ref_pic_list1=<optimized out>) at ../sys/va/gstvah265dec.c:552
header = 0x7fff6439dc08
nalu = 0x7fff6439df78
base = 0x7fff6439ea60
self = 0x7fff6439ea60
va_pic = <optimized out>
slice_param = 0x7fff6439f68c
Seems that picture
is NULL for some reason.
To reproduce:
GST_PLUGIN_FEATURE_RANK=vah265dec:300 gst-play-1.0 --videosink=glimagesink 'https://dl5.webmfiles.org/video-h265.mkv'
Seek few times with right arrow on terminal after playback starts. Crash seems to happen when seeking to any point after next keyframe (after around 10th second).