X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdnxhd_parser.c;h=63b4ff89e138ddd564ea159ea4bc2faecabc751e;hb=0181162bb54ce62ec212436a12d059726d8cd1df;hp=79ca1d6718845ffaab35bbf806f78795013c5510;hpb=725ae0e2d0222f81b5cca3b0b226116ec6fd0494;p=ffmpeg diff --git a/libavcodec/dnxhd_parser.c b/libavcodec/dnxhd_parser.c index 79ca1d67188..63b4ff89e13 100644 --- a/libavcodec/dnxhd_parser.c +++ b/libavcodec/dnxhd_parser.c @@ -75,14 +75,13 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx, remaining = avpriv_dnxhd_get_frame_size(cid); if (remaining <= 0) { - remaining = ff_dnxhd_get_hr_frame_size(cid, dctx->w, dctx->h); + remaining = avpriv_dnxhd_get_hr_frame_size(cid, dctx->w, dctx->h); if (remaining <= 0) continue; } + remaining += i - 47; dctx->remaining = remaining; - if (buf_size - i + 47 >= dctx->remaining) { - int remaining = dctx->remaining; - + if (buf_size >= dctx->remaining) { pc->frame_start_found = 0; pc->state64 = -1; dctx->cur_byte = 0; @@ -90,6 +89,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; } } }