[FFmpeg-cvslog] lavc/utils: in avcodec_decode_video2() return proper error code instead of -1

Stefano Sabatini git at videolan.org
Sat Jun 16 00:35:35 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Thu Jun 14 13:02:57 2012 +0200| [3cc1a8988112896e302c96f9df8839d983677891] | committer: Stefano Sabatini

lavc/utils: in avcodec_decode_video2() return proper error code instead of -1

Return AVERROR(EINVAL) in case of invalid coded size.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3cc1a8988112896e302c96f9df8839d983677891
---

 libavcodec/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8ed78d6..315dc57 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1461,7 +1461,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
 
     *got_picture_ptr= 0;
     if((avctx->coded_width||avctx->coded_height) && av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx))
-        return -1;
+        return AVERROR(EINVAL);
 
     if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type&FF_THREAD_FRAME)){
         int did_split = av_packet_split_side_data(&tmp);



More information about the ffmpeg-cvslog mailing list