From: Steve Lhomme Date: Thu, 18 Jul 2024 07:23:58 +0000 (+0200) Subject: magnify: check the image conversion worked X-Git-Tag: archive/raspbian/3.0.21-7+rpi1^2~108 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4120fe51fd7ce51d2c0a607a06426bf105ab3ada;p=vlc.git magnify: check the image conversion worked return NULL on failure as we cannot produce the required output. Fixes #28707 (cherry picked from commit 990de75bc0a7db5f2c4e4cb88e868b75b689ac7d) (rebased) rebased: - picture_CopyPixels is called picture_CopyVisiblePixels on 4.0 Signed-off-by: Steve Lhomme Gbp-Pq: Name 0018-magnify-check-the-image-conversion-worked.patch --- diff --git a/modules/video_filter/magnify.c b/modules/video_filter/magnify.c index 5f94f2d6..375e6e7f 100644 --- a/modules/video_filter/magnify.c +++ b/modules/video_filter/magnify.c @@ -244,6 +244,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) /* */ fmt_out = p_filter->fmt_out.video; p_converted = image_Convert( p_sys->p_image, p_pic, &fmt_in, &fmt_out ); + if (unlikely(!p_converted)) + { + picture_Release( p_outpic ); + return NULL; + } memcpy(p_pic->p, orig_planes, sizeof orig_planes); picture_CopyPixels( p_outpic, p_converted ); @@ -267,6 +272,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) fmt_out.i_height = fmt_out.i_visible_height = (fmt_out.i_visible_height/VIS_ZOOM) & ~1; p_converted = image_Convert( p_sys->p_image, p_pic, &p_pic->format, &fmt_out ); + if (unlikely(!p_converted)) + { + picture_Release( p_outpic ); + return NULL; + } /* It will put only what can be copied at the top left */ picture_CopyVisiblePixels( p_outpic, p_converted );