1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-11 03:45:05 +02:00
Commit Graph

20 Commits

Author SHA1 Message Date
Michael Niedermayer
15dd56c093 avcodec/h2645_parse: fix nal size
Found-by: <durandal_1707>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-20 00:40:43 +02:00
Michael Niedermayer
528171ba84 avcodec/h2645_parse: Use get_nalsize() in ff_h2645_packet_split()
This fixes several regressions in h.264

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-20 00:39:07 +02:00
Michael Niedermayer
382a68b008 vcodec/h2645_parse: Clear buffer padding
Fixes use of uninitialized memory
Fixes: 044100cb22845944988a4bd821ff8074/asan_heap-oob_329927a_1366_c3de34ce9217dac820fbb46171031bbb.jsv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-18 23:36:18 +02:00
Michael Niedermayer
cc13bc8c4f avcodec/h2645: Fix NAL unit padding
The parser changes have lost the support for the needed padding, this adds it back
Fixes out of array reads
Fixes: 03ea21d271abc8acf428d42ace51d8b4/asan_heap-oob_3358eef_5692_16f0cc01ab5225e9ce591659e5c20e35.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-18 23:36:18 +02:00
Hendrik Leppkes
83a940e7fb 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.
2016-07-08 15:20:20 +02:00
Hendrik Leppkes
c3e9b098e1 h2645_parse: only read avc length code at the correct position
Reading it from any other position would result in a wrong size being
read, instead fallback to the re-sync mechanic in the else clause.
2016-07-08 15:20:16 +02:00
Hendrik Leppkes
a9bb4cf87d h2645_parse: support badly muxed mp4 streams
Some streams contain an additional AnnexB NAL inside the mp4/nalff NALU.
This commonly occurs in interlaced streams where both fields are packed
into the same MP4 NAL with an AnnexB startcode in between.

Port handling of this format from the previous h264 nal handling.

Fixes trac #5529
2016-05-17 14:03:21 +02:00
Hendrik Leppkes
d46e856350 h265_parse: skip zero sized NAL units
Avoids extra error checks later on and/or invalid reads.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-07 21:14:23 +01:00
Hendrik Leppkes
9cc1ab63ac h2645_parse: allow partial escaping
This ports the fix from 033a533 to the new parser module in prepartion
of using it for the h264 decoder.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-07 21:11:21 +01:00
Hendrik Leppkes
c802389393 h2645_parse: initialize the GetBitContext to the proper size
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-07 21:11:10 +01:00
Derek Buitenhuis
79aafd43fd Merge commit '90ed6c5cf7f236bc9efb47c97b40358c666d1386'
* commit '90ed6c5cf7f236bc9efb47c97b40358c666d1386':
  h2645_parse: compute the actual data length, without trailing paddding

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 14:27:35 +01:00
Derek Buitenhuis
438ed974b8 Merge commit 'b667252a41fbf5a3f6ea8c67fdbc03db3d748977'
* commit 'b667252a41fbf5a3f6ea8c67fdbc03db3d748977':
  h2645_parse: add support for parsing h264

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 14:07:03 +01:00
Derek Buitenhuis
b5c10c4c92 Merge commit '52ec149fbee57b6ca817049c9706212a0774a32c'
* commit '52ec149fbee57b6ca817049c9706212a0774a32c':
  h2645_parse: change the AVCodecContext* parameter to void*

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 14:04:48 +01:00
Derek Buitenhuis
8e73574d4f Merge commit '8229eff4b7a98ae5d85bb75f3bb072781b4a8ebe'
* commit '8229eff4b7a98ae5d85bb75f3bb072781b4a8ebe':
  h2645_parse: add a function for uninitializing the packet

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 14:01:45 +01:00
Derek Buitenhuis
3c4ca4c5d7 Merge commit 'fa936a307f5cddfc2664600157a8207ca8080af6'
* commit 'fa936a307f5cddfc2664600157a8207ca8080af6':
  hevc_parse: rename into h2645_parse

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 13:56:47 +01:00
Anton Khirnov
90ed6c5cf7 h2645_parse: compute the actual data length, without trailing paddding
This is required by h264.
2016-03-28 09:47:25 +02:00
Anton Khirnov
b667252a41 h2645_parse: add support for parsing h264 2016-03-28 09:45:04 +02:00
Anton Khirnov
52ec149fbe h2645_parse: change the AVCodecContext* parameter to void*
This should make it more clear that it is not supposed to be used for
anything except logging.
2016-03-28 09:43:31 +02:00
Anton Khirnov
8229eff4b7 h2645_parse: add a function for uninitializing the packet 2016-03-28 09:43:18 +02:00
Anton Khirnov
fa936a307f hevc_parse: rename into h2645_parse
This code will be shared with h264.
2016-03-28 09:42:44 +02:00