[FFmpeg-devel] [PATCH 3/3] pictordec: support uncompressed images

Michael Niedermayer michaelni at gmx.at
Thu Dec 1 14:50:05 CET 2011


On Thu, Dec 01, 2011 at 07:17:28PM +1100, Peter Ross wrote:
> ---
>  libavcodec/pictordec.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c
> index ca3e791..c19fec5 100644
> --- a/libavcodec/pictordec.c
> +++ b/libavcodec/pictordec.c
> @@ -228,8 +228,9 @@ static int decode_frame(AVCodecContext *avctx,
>              }
>          }
>      } else {
> -        av_log_ask_for_sample(avctx, "uncompressed image\n");
> -        return buf_size;
> +        if (buf_end - buf < avctx->width * avctx->height)
> +            return AVERROR_INVALIDDATA;
> +        avpicture_fill((AVPicture *)&s->frame, buf, PIX_FMT_RGB8, avctx->width, avctx->height);
>      }

iam not sure mixing avpicture_fill with release_buffer() is safe,


[..]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- 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/20111201/b399609d/attachment.asc>


More information about the ffmpeg-devel mailing list