preparser: fix memory leaks
Fixes a crash (android) or hang (windows) when calling libvlc_media_thumbnail_request_by_pos
or similar, with fast
option only. Memory blows up also.
Android logs:
1280x720 (1280x720) chroma: ARGB colorspace: BT709 with scaling using Bicubic (good quality)
09-10 15:10:40.845 8562 8651 I Unity : libvlc Debug: using video converter module "swscale"
09-10 15:10:40.845 8562 8646 I Unity : libvlc Error: Unknown option "noise_reduction"
09-10 15:10:40.845 8562 8648 I Unity : libvlc Debug: Time base for probing set to 1/25
09-10 15:10:40.845 8562 8650 I Unity : libvlc Debug: Time base set to 1/25
09-10 15:10:40.845 8562 8647 I Unity : libvlc Error: Unknown option "border_mask"
09-10 15:10:40.867 8562 8649 I Unity : libvlc Debug: removing "video converter" module "swscale"
09-10 15:10:40.877 8562 8587 F libc : ../../include/vlc_atomic.h:75: _Bool vlc_atomic_rc_dec(vlc_atomic_rc_t *): assertion "prev" failed
09-10 15:10:40.886 8562 8587 E CRASH : #02 pc 0000000000fac99c /data/app/~~6rXy9tExR6zBtOYQOIgKow==/com.immerVR.VLCTestAndroid20241127-scDXA5uJFt_tHFtPuLR76w==/lib/arm64/libvlc.so (libvlc_picture_save) (BuildId: 59aa2d095af161d7a6f9d5eecebb2cb87758e12a)
09-10 15:10:41.265 8670 8670 F DEBUG : Abort message: '../../include/vlc_atomic.h:75: _Bool vlc_atomic_rc_dec(vlc_atomic_rc_t *): assertion "prev" failed'
09-10 15:10:41.265 8670 8670 F DEBUG : #02 pc 0000000000fac99c /data/app/~~6rXy9tExR6zBtOYQOIgKow==/com.immerVR.VLCTestAndroid20241127-scDXA5uJFt_tHFtPuLR76w==/lib/arm64/libvlc.so (libvlc_picture_release+168) (BuildId: 59aa2d095af161d7a6f9d5eecebb2cb87758e12a)
Sample for repro: https://filebin.net/e8ul3u6fnsz7nkwl/oculus.mkv.
/cc @tguillem