[FFmpeg-cvslog] avcodec/mpegvideo_dec, h264_slice: Return proper error codes

Andreas Rheinhardt git at videolan.org
Mon Apr 8 16:18:46 EEST 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Apr  5 11:58:44 2024 +0200| [17414abb69b44675fd9964069f948a4d48b1ec5e] | committer: Andreas Rheinhardt

avcodec/mpegvideo_dec, h264_slice: Return proper error codes

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/h264_slice.c    | 2 +-
 libavcodec/mpegvideo_dec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 4b01c54147..a346839902 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -483,7 +483,7 @@ static int h264_frame_start(H264Context *h)
 
     if (!ff_thread_can_start_frame(h->avctx)) {
         av_log(h->avctx, AV_LOG_ERROR, "Attempt to start a frame outside SETUP state\n");
-        return -1;
+        return AVERROR_BUG;
     }
 
     release_unused_pictures(h, 1);
diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
index d337a6565b..4353f1fd68 100644
--- a/libavcodec/mpegvideo_dec.c
+++ b/libavcodec/mpegvideo_dec.c
@@ -328,7 +328,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
 
     if (!ff_thread_can_start_frame(avctx)) {
         av_log(avctx, AV_LOG_ERROR, "Attempt to start a frame outside SETUP state\n");
-        return -1;
+        return AVERROR_BUG;
     }
 
     /* mark & release old frames */



More information about the ffmpeg-cvslog mailing list