[FFmpeg-cvslog] h2645_parse: don't overread AnnexB NALs within an avc stream

Hendrik Leppkes git at videolan.org
Fri Jul 8 15:38:50 CEST 2016


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Thu Jul  7 20:19:51 2016 +0200| [83a940e7fb9640954d631870e2ec6e8b3fc528ed] | committer: Hendrik Leppkes

h2645_parse: don't overread AnnexB NALs within an avc stream

We know the maximum size of an AnnexB NAL, signaling it as the maximum
NAL size allows ff_h2645_extract_rbsp to determine the correct size.

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

 libavcodec/h2645_parse.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index 26f2e85..ef872fe 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -293,7 +293,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
 
             buf           += 3;
             length        -= 3;
-            extract_length = length;
+            extract_length = FFMIN(length, next_avc - buf);
 
             if (buf >= next_avc) {
                 /* skip to the start of the next NAL */



More information about the ffmpeg-cvslog mailing list