]> git.sesse.net Git - ffmpeg/commitdiff
lavf/latmenc: fix units mismatch
authorAnton Khirnov <anton@khirnov.net>
Mon, 26 Oct 2020 12:04:33 +0000 (13:04 +0100)
committerAnton Khirnov <anton@khirnov.net>
Wed, 28 Oct 2020 12:53:23 +0000 (13:53 +0100)
avpriv_copy_bits() takes the size in bits, not bytes. According to
a736eb4a605f46d5ff96c7b32e55710ecd9cce89, nobody is quite sure whether
this code produces working files.

libavformat/latmenc.c

index 5458ce2596ba08481a7cbe0889fad8801955bd22..684483bc71bee0a133bc3a82370510e33f632c10 100644 (file)
@@ -120,7 +120,7 @@ static void latm_write_frame_header(AVFormatContext *s, PutBitContext *bs)
 
         /* AudioSpecificConfig */
         if (ctx->object_type == AOT_ALS) {
-            header_size = par->extradata_size-(ctx->off >> 3);
+            header_size = (par->extradata_size - (ctx->off >> 3)) * 8;
             avpriv_copy_bits(bs, &par->extradata[ctx->off >> 3], header_size);
         } else {
             // + 3 assumes not scalable and dependsOnCoreCoder == 0,