Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7802c68a authored by Dongwon Kang's avatar Dongwon Kang
Browse files

m4v_h263: add a test for invalid/negative value

Test: run poc with and without the patch.
Bug: 134578122
Change-Id: I2d11826d1d9e2669aa5627065dc627729ddc823b
parent e3342733
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -52,7 +52,11 @@ PV_STATUS PV_ReadVideoPacketHeader(VideoDecData *video, int *next_MB)
        PV_BitstreamByteAlign(stream);
        BitstreamReadBits32(stream, resync_marker_length);

        *next_MB = (int) BitstreamReadBits16(stream, nbits);
        int mbnum = (int) BitstreamReadBits16(stream, nbits);
        if (mbnum < 0) {
            return PV_FAIL;
        }
        *next_MB = mbnum;
//      if (*next_MB <= video->mbnum)   /*  needs more investigation */
//          *next_MB = video->mbnum+1;