[FFmpeg-cvslog] avformat/mp3dec: change bogus error message if read_header encounters EOF

Marton Balint git at videolan.org
Tue May 21 10:03:06 EEST 2024


ffmpeg | branch: release/6.1 | Marton Balint <cus at passwd.hu> | Sun May 12 19:26:24 2024 +0200| [fcce52871326e0ca722a01c951bbf780a5d463fc] | committer: Marton Balint

avformat/mp3dec: change bogus error message if read_header encounters EOF

Because of ffio_ensure_seekback() a seek error normally should only happen if
the end of file is reached during checking for the junk run-in. Also use proper
error code.

Signed-off-by: Marton Balint <cus at passwd.hu>
(cherry picked from commit 49e018d6fee689af6b30b773d83f545d74b8d9aa)

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

 libavformat/mp3dec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index eee9c17c0b..a0edb195b5 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -415,8 +415,8 @@ static int mp3_read_header(AVFormatContext *s)
             if (ret >= 0 && (header & MP3_MASK) == (header2 & MP3_MASK))
                 break;
         } else if (frame_size == CHECK_SEEK_FAILED) {
-            av_log(s, AV_LOG_ERROR, "Failed to read frame size: Could not seek to %"PRId64".\n", (int64_t) (i + 1024 + frame_size + 4));
-            return AVERROR(EINVAL);
+            av_log(s, AV_LOG_ERROR, "Failed to find two consecutive MPEG audio frames.\n");
+            return AVERROR_INVALIDDATA;
         }
     }
     if (i == 64 * 1024) {



More information about the ffmpeg-cvslog mailing list