]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/extract_extradata: Remove always-true check
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 7 Sep 2020 12:44:04 +0000 (14:44 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 11 Sep 2020 12:38:18 +0000 (14:38 +0200)
If a sequence header has already been found, it is certain that next
startcode (being disjoint from the sequence header startcode) can begin
at index four at the earliest.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/extract_extradata_bsf.c

index 6e80076522d37b618059f07c8ec8a839f94abc06..38517bdcf30f18646fcf03ce397ae859e2dc9a9d 100644 (file)
@@ -275,7 +275,6 @@ static int extract_extradata_mpeg12(AVBSFContext *ctx, AVPacket *pkt,
         if (state == 0x1B3)
             found = 1;
         else if (found && state != 0x1B5 && state < 0x200 && state >= 0x100) {
-            if (i > 3) {
                 *size = i - 3;
                 *data = av_malloc(*size + AV_INPUT_BUFFER_PADDING_SIZE);
                 if (!*data)
@@ -287,7 +286,6 @@ static int extract_extradata_mpeg12(AVBSFContext *ctx, AVPacket *pkt,
                     pkt->data += *size;
                     pkt->size -= *size;
                 }
-            }
             break;
         }
     }