diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-04-17 20:26:01 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-04-25 23:01:37 +0200 |
commit | a2acb46a6e38ece29d0228112cb4790721f05620 (patch) | |
tree | 068871657c40bf60a1f01553541edb8edde8d427 | |
parent | be7495c32ce64d4d32f9e3c6684899d5217db0ea (diff) | |
download | ffmpeg-a2acb46a6e38ece29d0228112cb4790721f05620.tar.gz |
avcodec/vp6: Forward error codes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/vp6.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index 69cfc5fa8b..48ff9da818 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -298,6 +298,7 @@ static int vp6_parse_coeff_models(VP56Context *s) int node, cg, ctx, pos; int ct; /* code type */ int pt; /* plane type (0 for Y, 1 for U or V) */ + int ret; memset(def_prob, 0x80, sizeof(def_prob)); @@ -335,21 +336,25 @@ static int vp6_parse_coeff_models(VP56Context *s) if (s->use_huffman) { for (pt=0; pt<2; pt++) { - if (vp6_build_huff_tree(s, model->coeff_dccv[pt], - vp6_huff_coeff_map, 12, AC_DC_HUFF_BITS, - &s->dccv_vlc[pt])) - return -1; - if (vp6_build_huff_tree(s, model->coeff_runv[pt], - vp6_huff_run_map, 9, RUN_HUFF_BITS, - &s->runv_vlc[pt])) - return -1; + ret = vp6_build_huff_tree(s, model->coeff_dccv[pt], + vp6_huff_coeff_map, 12, AC_DC_HUFF_BITS, + &s->dccv_vlc[pt]); + if (ret < 0) + return ret; + ret = vp6_build_huff_tree(s, model->coeff_runv[pt], + vp6_huff_run_map, 9, RUN_HUFF_BITS, + &s->runv_vlc[pt]); + if (ret < 0) + return ret; for (ct=0; ct<3; ct++) - for (int cg = 0; cg < 4; cg++) - if (vp6_build_huff_tree(s, model->coeff_ract[pt][ct][cg], - vp6_huff_coeff_map, 12, - AC_DC_HUFF_BITS, - &s->ract_vlc[pt][ct][cg])) - return -1; + for (int cg = 0; cg < 4; cg++) { + ret = vp6_build_huff_tree(s, model->coeff_ract[pt][ct][cg], + vp6_huff_coeff_map, 12, + AC_DC_HUFF_BITS, + &s->ract_vlc[pt][ct][cg]); + if (ret < 0) + return ret; + } } memset(s->nb_null, 0, sizeof(s->nb_null)); } else { |