[FFmpeg-cvslog] avformat/avidec: Check height

Michael Niedermayer git at videolan.org
Fri Apr 8 01:31:57 EEST 2022


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Feb 27 21:44:29 2022 +0100| [78707ae0255d892b26b3b85976775a0514f4f94d] | committer: Michael Niedermayer

avformat/avidec: Check height

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: Ticket8486

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit ec8ff659f57786c4cb089b07dfeab7e5cbab8d52)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/avidec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index ebf3a3d9c6..2635bbac28 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -846,6 +846,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
                             memcpy(st->codecpar->extradata + st->codecpar->extradata_size - 9,
                                    "BottomUp", 9);
                     }
+                    if (st->codecpar->height == INT_MIN)
+                        return AVERROR_INVALIDDATA;
                     st->codecpar->height = FFABS(st->codecpar->height);
 
 //                    avio_skip(pb, size - 5 * 4);



More information about the ffmpeg-cvslog mailing list