[FFmpeg-devel] [PATCH 2/3] avcodec/av1dec: Don't rely on AV_PIX_FMT_NONE == -1

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Sep 10 15:53:30 EEST 2023


Since fb548fba04193a418f118d21b261ba05db4f480b,
this return -1 is in a function returning enum AVPixelFormat
whose caller checks for AV_PIX_FMT_NONE for failure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/av1dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 8f6c4f732e..c523c457ec 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -453,7 +453,7 @@ static enum AVPixelFormat get_sw_pixel_format(void *logctx,
     else {
         av_log(logctx, AV_LOG_ERROR,
                "Unknown AV1 profile %d.\n", seq->seq_profile);
-        return -1;
+        return AV_PIX_FMT_NONE;
     }
 
     if (!seq->color_config.mono_chrome) {
-- 
2.34.1



More information about the ffmpeg-devel mailing list