[FFmpeg-devel,3/5] avcodec/dnxhd_parser: Optimize insufficient buf size case

Submitted by Michael Niedermayer on July 6, 2019, 10:57 a.m.

Details

Message ID 20190706105749.11410-3-michael@niedermayer.cc
State Accepted
Commit 827faa18cfd08eed49ffff9129ef4378b8ccf5a5
Headers show

Commit Message

Michael Niedermayer July 6, 2019, 10:57 a.m.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/dnxhd_parser.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/libavcodec/dnxhd_parser.c b/libavcodec/dnxhd_parser.c
index f657af8f41..31a3158fea 100644
--- a/libavcodec/dnxhd_parser.c
+++ b/libavcodec/dnxhd_parser.c
@@ -88,6 +88,10 @@  static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
                     return remaining;
                 } else {
                     dctx->remaining -= buf_size;
+                    // Update variables for correctness, they are currently not used beyond here
+                    state = -1;
+                    dctx->cur_byte += buf_size - i;
+                    break;
                 }
             }
         }