[FFmpeg-devel] [PATCH] avcodec/rv10: check size of s->mb_width * s->mb_height

Michael Niedermayer michaelni at gmx.at
Mon Mar 2 19:37:28 CET 2015


On Mon, Mar 02, 2015 at 07:18:10PM +0100, Andreas Cadhalpun wrote:
> On 02.03.2015 18:35, Michael Niedermayer wrote:
> >On Mon, Mar 02, 2015 at 05:52:52PM +0100, Andreas Cadhalpun wrote:
> >>Hi,
> >>
> >>encoding large frames with rv10 currently results in an assertion,
> >>because the number of macro blocks doesn't fit into 12 bits.
> >>
> >>Attached patch avoids this by just not trying to write the macro
> >>block number in that case. The decoder can figure it out on it's
> >>own:
> >
> >what does the binary encoder / decoder do in this case ?
> >changes to the encoded bitstream should be checked against a
> >specification or if none exists the binary decoder or encoder
> >to ensure that we arent generating invalid bitstreams
> 
> Probably it encodes multiple packets per frame then. This is what
> these fields are for, according to the comment above them. But

one still could test the bitstream generated by our encoder against
the binary decoder, that is if the patch results in a supported
bitstream or not


> despite setting full_frame=0, ff_rv10_encode_picture_header always
> writes 0 for mb_x and mb_y, i.e. it encodes a full frame.
> So maybe a better fix would be to set full_frame=1?
> 
> >i suspect we dont have rv10 samples with high enough resolution but
> >if we do have, these could be used to ensure what we store is
> >correct
> >real video samples should be here: http://samples.ffmpeg.org/real/
> 
> As said I think the correct way would be to encode multiple packets
> per frame, which is currently not supported in FFmpeg.
> 

> So would you prefer using avpriv_report_missing_feature, returning
> an error and checking the return value in
> libavcodec/mpegvideo_enc.c?

if you dont have easy access to the real networks binary decoder
and noone else can check it either then failing with
avpriv_report_missing_feature, might be safer

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

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150302/657e5f26/attachment.asc>


More information about the ffmpeg-devel mailing list