[FFmpeg-devel] [PATCH 1/2] h2645_parse: only read avc length code at the correct position

Michael Niedermayer michael at niedermayer.cc
Fri Jul 8 03:25:19 EEST 2016


On Thu, Jul 07, 2016 at 08:21:17PM +0200, Hendrik Leppkes wrote:
> 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.
> ---
>  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 9979b63..09fbc80 100644
> --- a/libavcodec/h2645_parse.c
> +++ b/libavcodec/h2645_parse.c
> @@ -258,7 +258,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
>          int extract_length = 0;
>          int skip_trailing_zeros = 1;
>  
> -        if (buf >= next_avc) {
> +        if (buf == next_avc) {
>              int i;
>              for (i = 0; i < nal_length_size; i++)
>                  extract_length = (extract_length << 8) | buf[i];

the > case should print some warning if it doesnt,
same for the 2nd patch the truncation should show some warning

otherwise patches LGTM

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160708/7989bd2c/attachment.sig>


More information about the ffmpeg-devel mailing list