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

Peter Ross pross at xvid.org
Thu Dec 1 09:17:28 CET 2011


---
 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);
     }
 
     *data_size = sizeof(AVFrame);
-- 
1.7.7.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- 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/5066f674/attachment.asc>


More information about the ffmpeg-devel mailing list