diff mbox

[FFmpeg-devel,v2,2/3] lavc/hevc_mp4toannexb: Simplify error check

Message ID 20191204000411.29765-2-andriy.gelman@gmail.com
State New
Headers show

Commit Message

Andriy Gelman Dec. 4, 2019, 12:04 a.m. UTC
From: Andriy Gelman <andriy.gelman@gmail.com>

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
---
 libavcodec/hevc_mp4toannexb_bsf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/libavcodec/hevc_mp4toannexb_bsf.c b/libavcodec/hevc_mp4toannexb_bsf.c
index bf4c25b3b7b..faf516634b2 100644
--- a/libavcodec/hevc_mp4toannexb_bsf.c
+++ b/libavcodec/hevc_mp4toannexb_bsf.c
@@ -152,8 +152,7 @@  static int hevc_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out)
         extra_size    = add_extradata * ctx->par_out->extradata_size;
         got_irap     |= is_irap;
 
-        if (INT_MAX < 4 + (uint64_t)nalu_size ||
-            INT_MAX - 4 < extra_size + (uint64_t)nalu_size) {
+        if (INT_MAX < 4 + (uint64_t)nalu_size + extra_size) {
             ret = AVERROR_INVALIDDATA;
             goto fail;
         }