[FFmpeg-cvslog] avcodec/mjpegdec: check that component linesize is always valid

Paul B Mahol git at videolan.org
Fri Dec 9 00:49:53 EET 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Dec  8 23:49:33 2022 +0100| [55753fc712622744093c8050b779c3d830c427cb] | committer: Paul B Mahol

avcodec/mjpegdec: check that component linesize is always valid

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=55753fc712622744093c8050b779c3d830c427cb
---

 libavcodec/mjpegdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 9b7465abe7..228d3077b9 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1512,7 +1512,7 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
                                        "error y=%d x=%d\n", mb_y, mb_x);
                                 return AVERROR_INVALIDDATA;
                             }
-                            if (ptr) {
+                            if (ptr && linesize[c]) {
                                 s->idsp.idct_put(ptr, linesize[c], s->block);
                                 if (s->bits & 7)
                                     shift_output(s, ptr, linesize[c]);



More information about the ffmpeg-cvslog mailing list