[FFmpeg-devel] [PATCH 05/19] mpc8: fix return value for small overreads.

Michael Niedermayer michaelni at gmx.at
Sun Jul 29 18:01:42 CEST 2012


On Sun, Jul 29, 2012 at 03:57:23PM +0200, Nicolas George wrote:
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavcodec/mpc8.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
> index d9594ec..2161aac 100644
> --- a/libavcodec/mpc8.c
> +++ b/libavcodec/mpc8.c
> @@ -425,7 +425,10 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
>      *got_frame_ptr   = 1;
>      *(AVFrame *)data = c->frame;
>  
> -    return c->cur_frame ? c->last_bits_used >> 3 : buf_size;
> +    res = c->cur_frame ? c->last_bits_used >> 3 : buf_size;
> +    if (res > avpkt->size && res <= avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE)
> +        res = avpkt->size; /* small overreads are acceptable */
> +    return res;
>  }

I dont think this is correct
in the case where overread happens is the additionally read data
affecting decoder output ? should the decoder stop before maybe ?


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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- 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/20120729/ec678806/attachment.asc>


More information about the ffmpeg-devel mailing list