[FFmpeg-devel] [PATCH][RFC] Fix field order for interlaced AVDJ and AVRN in ntsc mode
Michael Niedermayer
michaelni at gmx.at
Sun May 12 18:29:56 CEST 2013
On Sun, May 12, 2013 at 02:15:52PM +0200, Piotr Bandurski wrote:
> Hi,
>
> Attached patch fixes decoding of interlaced AVDJ and AVRn in ntsc mode (ticket #1656).
>
> The only problem is that I get
>
> [mjpeg @ 01b4c620] mjpeg: error, decode_app parser read over the end
>
> so how many bytes should I subtract?
>
> AVDJ samples:
>
> http://www1.datafilehost.com/d/e11fadc3
>
> Regards
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index b439547..41df345 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -1374,9 +1374,15 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
> 4bytes field_size
> 4bytes field_size_less_padding
> */
> + int mode; /* 1 - ntsc, 2 - pal */
> s->buggy_avid = 1;
> i = get_bits(&s->gb, 8); len--;
> av_log(s->avctx, AV_LOG_DEBUG, "polarity %d\n", i);
> + skip_bits(&s->gb, 200);
> + mode = get_bits(&s->gb, 8);
> + if (mode == 1)
> + s->interlace_polarity = 1;
> + len -= 26;
this needs a check on len being big enough
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is what and why we do it that matters, not just one of them.
-------------- 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/20130512/d20c2589/attachment.asc>
More information about the ffmpeg-devel
mailing list