[FFmpeg-cvslog] avformat/lafdec: error out on partial packet header read

Paul B Mahol git at videolan.org
Sat Feb 4 10:41:47 EET 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Feb  4 08:52:42 2023 +0100| [332a4d798d5c0bc3de809f6db22e99ae428d2776] | committer: Paul B Mahol

avformat/lafdec: error out on partial packet header read

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

 libavformat/lafdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/lafdec.c b/libavformat/lafdec.c
index d6ef8415a9..d63d76d74f 100644
--- a/libavformat/lafdec.c
+++ b/libavformat/lafdec.c
@@ -185,7 +185,9 @@ again:
     if (s->index >= ctx->nb_streams) {
         int cur_st = 0, st_count = 0, st_index = 0;
 
-        avio_read(pb, s->header, s->header_len);
+        ret = ffio_read_size(pb, s->header, s->header_len);
+        if (ret < 0)
+            return ret;
         for (int i = 0; i < s->header_len; i++) {
             uint8_t val = s->header[i];
 



More information about the ffmpeg-cvslog mailing list