[FFmpeg-devel] [PATCH] avcodec/dnxhd_parser: take into account compressed frame size and skip it

Clément Bœsch u at pkh.me
Tue Mar 21 16:47:08 EET 2017


On Tue, Mar 21, 2017 at 03:36:39PM +0100, Paul B Mahol wrote:
> Fixes #6214.
> 
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/dnxhd_parser.c | 65 ++++++++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 58 insertions(+), 7 deletions(-)
> 
> diff --git a/libavcodec/dnxhd_parser.c b/libavcodec/dnxhd_parser.c
> index 033b8ee..4f9bbce 100644
> --- a/libavcodec/dnxhd_parser.c
> +++ b/libavcodec/dnxhd_parser.c
> @@ -31,8 +31,24 @@ typedef struct {
>      ParseContext pc;
>      int interlaced;
>      int cur_field; /* first field is 0, second is 1 */
> +    int cur_byte;
> +    int remaining;
> +    int w, h;
>  } DNXHDParserContext;
>  
> +static int dnxhd_get_hr_frame_size(int cid, int w, int h)
> +{
> +    int result, i = ff_dnxhd_get_cid_table(cid);
> +
> +    if (i < 0)
> +        return i;
> +

> +    result = ((h + 15) / 16) * ((w + 15) / 16) * ff_dnxhd_cid_table[i].packet_scale.num / ff_dnxhd_cid_table[i].packet_scale.den;

result = AV_CEIL_RSHIFT(h, 4) * AV_CEIL_RSHIFT(w, 4) * ... or am I missing something?

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170321/54de9d8e/attachment.sig>


More information about the ffmpeg-devel mailing list