nvcodec: nvh265dec memory leak with SEI USER DATA UNREGISTERED messages and rtph265pay aggregate-mode != 0
This memory leak can be reproduced using the the attached video sample testvideo_sei_user_data_unregistered.h265 which includes one SEI_USER_DATA_UNREGISTERED per frame and the following pipeline:
GST_DEBUG_FILE=logfile.log GST_DEBUG=6 gst-launch-1.0 filesrc location=testvideo_sei_user_data_unregistered.h265 ! h265parse ! rtph265pay pt=96 aggregate-mode=1 ! rtph265depay ! h265parse ! nvh265dec ! autovideosink sync=true
Memory usage grows as the stream continues playing. The leak reproduces with aggregate-mode=2 but not aggregate-mode=0
grepping the logfile using cat logfile.log | grep "internal leaking"
produces a series of this line with an ever growing frame count
0:00:05.186533345 31345 0x23d52d0 DEBUG videodecoder gstvideodecoder.c:3695:gst_video_decoder_decode_frame:<nvh265dec0> decoder frame list getting long: 480 frames,possible internal leaking?
0:00:05.189712439 31345 0x23d52d0 DEBUG videodecoder gstvideodecoder.c:3695:gst_video_decoder_decode_frame:<nvh265dec0> decoder frame list getting long: 480 frames,possible internal leaking?
0:00:05.190511142 31345 0x23d52d0 DEBUG videodecoder gstvideodecoder.c:3695:gst_video_decoder_decode_frame:<nvh265dec0> decoder frame list getting long: 481 frames,possible internal leaking?
0:00:05.200007485 31345 0x23d52d0 DEBUG videodecoder gstvideodecoder.c:3695:gst_video_decoder_decode_frame:<nvh265dec0> decoder frame list getting long: 481 frames,possible internal leaking?
0:00:05.200773971 31345 0x23d52d0 DEBUG videodecoder gstvideodecoder.c:3695:gst_video_decoder_decode_frame:<nvh265dec0> decoder frame list getting long: 482 frames,possible internal leaking?
0:00:05.206634080 31345 0x23d52d0 DEBUG videodecoder gstvideodecoder.c:3695:gst_video_decoder_decode_frame:<nvh265dec0> decoder frame list getting long: 482 frames,possible internal leaking?
The leak does not reproduce using sample video that does not include SEI messages testvideo_no_sei.h265