[FFmpeg-cvslog] r18862 - trunk/libavcodec/tmv.c
Reimar Döffinger
Reimar.Doeffinger
Sun May 17 12:22:02 CEST 2009
On Sun, May 17, 2009 at 11:48:13AM +0200, vitor wrote:
> Modified: trunk/libavcodec/tmv.c
> ==============================================================================
> --- trunk/libavcodec/tmv.c Sun May 17 11:09:07 2009 (r18861)
> +++ trunk/libavcodec/tmv.c Sun May 17 11:48:12 2009 (r18862)
> @@ -52,6 +52,13 @@ static int tmv_decode_frame(AVCodecConte
> return -1;
> }
>
> + if (avpkt->size < 2*char_rows*char_cols) {
> + av_log(avctx, AV_LOG_ERROR,
> + "Input buffer too small, truncated sample?\n");
> + *data_size = 0;
> + return -1;
> + }
I understand it may not be worth it for this codec, but I'd like to
point out that I'd consider it nicer if - depending on some
error-concealment flag - instead of failing, it would
e.g. initialize the frame and set char_rows to something
appropriate for the amount of data available.
It is a silly example, but if e.g. someone remuxed this format and
a broken muxer always forgot to write the last byte, like this it
would be completely non-decodable although almost all data is available.
More information about the ffmpeg-cvslog
mailing list