[FFmpeg-devel] [PATCH v2 8/8] avformat/flvdec: Use appropriate error code

Zhao Zhili quinkblack at foxmail.com
Tue Mar 11 04:49:47 EET 2025


From: Zhao Zhili <zhilizhao at tencent.com>

---
 libavformat/flvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index b431dabffc..c51f64a588 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -489,7 +489,7 @@ static int amf_get_string(AVIOContext *ioc, char *buffer, int buffsize)
     int length = avio_rb16(ioc);
     if (length >= buffsize) {
         avio_skip(ioc, length);
-        return -1;
+        return AVERROR_INVALIDDATA;
     }
 
     ret = avio_read(ioc, buffer, length);
-- 
2.46.0



More information about the ffmpeg-devel mailing list