[FFmpeg-devel] [PATCH] MJPEG: emulate EOI also on two consecutive SOI.

Michael Niedermayer michaelni at gmx.at
Sat Aug 27 22:26:24 CEST 2011


On Sat, Aug 27, 2011 at 10:23:00PM +0200, Reimar Döffinger wrote:
> On Sat, Aug 27, 2011 at 06:52:21PM +0200, Michael Niedermayer wrote:
> > On Sat, Aug 27, 2011 at 02:43:04PM +0200, Reimar Döffinger wrote:
> > > Fixes issue #362.
> > > 
> > > Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> > > ---
> > >  libavcodec/mjpegdec.c |    4 ++++
> > >  1 files changed, 4 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> > > index 6331e3d..57ce821 100644
> > > --- a/libavcodec/mjpegdec.c
> > > +++ b/libavcodec/mjpegdec.c
> > > @@ -1430,6 +1430,10 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx,
> > >  
> > >                      s->restart_count = 0;
> > >                      /* nothing to do on SOI */
> > > +                    if (s->got_picture) {
> > > +                        av_log(avctx, AV_LOG_WARNING, "EOI missing, emulating\n");
> > > +                        goto eoi_parser;
> > 
> > should that not jump to 3 lines earlier to emulate EOI fully ?
> 
> I sent a patch to move resetting cur_scan.
> After that I think it is the right place to go to.
> The if as far as I can tell is there to avoid a warning for the buggy
> case when the EOI ends up at the wrong place. Or something like that.
> In either way if we encounter an SOI we really want the EOI code to
> be run, not skipped like that condition does.
> Though it might help to have that avid sample (and any others) that
> condition is supposed to check.
> So in short, for now I still think this proposed patch is doing the
> right thing.

ok then
my reasoning was that
we must support any crafted bitstream and thus turning one marker
into another is always safe.
doing things a bit different has the very small possibility of
introducing an issue ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110827/1cd94355/attachment.asc>


More information about the ffmpeg-devel mailing list