flaccidware / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

Incorrect frame len during remuxing #1032

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. compile sample_muxer.cpp 
2. try convert input any mkv/webm file -> to the same file
3. size of output file MUCH BIGGER (8 MB -> 500 MB)

look at the same portion of code (line 500+-):

          if (frame.len > data_len) {
            delete[] data;
            data = new unsigned char[frame.len];
            if (!data)
              return EXIT_FAILURE;
           data_len = frame.len;         // ERROR HERE -> LETS MOOVE IT OUT OF THE {}
       }
         // data_len = frame.len;   // SHOULD BE HERE!!!

          if (frame.Read(&reader, data))
            return EXIT_FAILURE;

          mkvmuxer::Frame muxer_frame;
          if (!muxer_frame.Init(data, data_len))

        Working file in attachment!

What is the expected output? What do you see instead?

What version are you using? On what Windows version?

Please provide any additional information below.

Original issue reported on code.google.com by AndreyAl...@gmail.com on 1 Jul 2015 at 12:32

Attachments:

GoogleCodeExporter commented 8 years ago
>            data_len = frame.len;         // ERROR HERE -> LETS MOOVE IT OUT 
OF THE {}

I think this line is actually correct. data_len is the length of the buffer. 
It's not the length of the frame payload. 

The issue is a few lines later where muxer_frame.Init() is called using 
data_len. That call should be using frame.len if I'm understanding what's going 
on here. The output file is getting huge because we're writing a file with 
frame payloads of a size that's always the size of the largest frame payload 
encountered up until the point of the frame write.

Thanks for reporting the issue!

Original comment by tomfine...@google.com on 1 Jul 2015 at 9:23

GoogleCodeExporter commented 8 years ago
Fix here:

https://chromium-review.googlesource.com/283140

Original comment by tomfine...@google.com on 1 Jul 2015 at 9:29

GoogleCodeExporter commented 8 years ago

Original comment by tomfine...@google.com on 1 Jul 2015 at 9:44