Message ID | 201608290012.34861.cehoyos@ag.or.at |
---|---|
State | Accepted |
Headers | show |
On Mon, Aug 29, 2016 at 12:12:34AM +0200, Carl Eugen Hoyos wrote: > Hi! > > Attached patch fixes ticket #5805. > > Please comment, Carl Eugen > mjpegdec.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > 4ccdddc80ba0dbd460f9d7ecb046cad73d50ea51 0001-lavc-mjpegdec-Only-read-JFIF-thumbnail-size-if-the-s.patch > From 215d45b2226cb5681be09bb4e0a2c135925ed6f5 Mon Sep 17 00:00:00 2001 > From: Carl Eugen Hoyos <cehoyos@ag.or.at> > Date: Mon, 29 Aug 2016 00:09:06 +0200 > Subject: [PATCH] lavc/mjpegdec: Only read JFIF thumbnail size if the segment > is long enough. > > Fixes ticket #5805. LGTM, can you add a fate test for this ? thx [...]
2016-08-29 12:59 GMT+02:00 Michael Niedermayer <michael@niedermayer.cc>: > On Mon, Aug 29, 2016 at 12:12:34AM +0200, Carl Eugen Hoyos wrote: >> Fixes ticket #5805. > > LGTM, Patch applied. > can you add a fate test for this ? Please upload the sample to fate-suite/jpg/. Thank you, Carl Eugen
On Sat, Sep 03, 2016 at 02:26:36PM +0200, Carl Eugen Hoyos wrote: > 2016-08-29 12:59 GMT+02:00 Michael Niedermayer <michael@niedermayer.cc>: > > On Mon, Aug 29, 2016 at 12:12:34AM +0200, Carl Eugen Hoyos wrote: > > >> Fixes ticket #5805. > > > > LGTM, > > Patch applied. > > > can you add a fate test for this ? > > Please upload the sample to fate-suite/jpg/. uploaded thx [...]
2016-09-03 19:58 GMT+02:00 Michael Niedermayer <michael@niedermayer.cc>: >> > can you add a fate test for this ? >> >> Please upload the sample to fate-suite/jpg/. > > uploaded Patch sent. Carl Eugen
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 633a8f0..515d2f8 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1690,6 +1690,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s) s->avctx->sample_aspect_ratio.num, s->avctx->sample_aspect_ratio.den); + len -= 8; + if (len >= 2) { t_w = get_bits(&s->gb, 8); t_h = get_bits(&s->gb, 8); if (t_w && t_h) { @@ -1697,7 +1699,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s) if (len -10 - (t_w * t_h * 3) > 0) len -= t_w * t_h * 3; } - len -= 10; + len -= 2; + } goto out; }
Hi! Attached patch fixes ticket #5805. Please comment, Carl Eugen From 215d45b2226cb5681be09bb4e0a2c135925ed6f5 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos <cehoyos@ag.or.at> Date: Mon, 29 Aug 2016 00:09:06 +0200 Subject: [PATCH] lavc/mjpegdec: Only read JFIF thumbnail size if the segment is long enough. Fixes ticket #5805. --- libavcodec/mjpegdec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)