[vlc-commits] dav1d: fix potential use of NULL picture
Steve Lhomme
git at videolan.org
Tue Nov 13 08:29:56 CET 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Nov 13 08:27:03 2018 +0100| [8ff6e5b509b4d6c3cc50b74967b5f4c5856ec7c1] | committer: Steve Lhomme
dav1d: fix potential use of NULL picture
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8ff6e5b509b4d6c3cc50b74967b5f4c5856ec7c1
---
modules/codec/dav1d.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
index f06e38ce70..18d7b3435b 100644
--- a/modules/codec/dav1d.c
+++ b/modules/codec/dav1d.c
@@ -220,8 +220,14 @@ static int Decode(decoder_t *dec, block_t *block)
if (res == 0)
{
- picture_t *pic = img.allocator_data;
- pic = picture_Clone(pic);
+ picture_t *_pic = img.allocator_data;
+ picture_t *pic = picture_Clone(_pic);
+ if (unlikely(pic == NULL))
+ {
+ i_ret = VLC_EGENERIC;
+ picture_Release(_pic);
+ break;
+ }
pic->b_progressive = true; /* codec does not support interlacing */
pic->date = timestamp_FifoGet(p_sys->ts_fifo);
/* TODO udpate the color primaries and such */
More information about the vlc-commits
mailing list