summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2016-06-16 17:15:38 +0200
committerAnton Khirnov <anton@khirnov.net>2016-07-25 13:57:01 +0200
commit76d3d08409e5c69c96d65bdae49db474ddd4b0d1 (patch)
tree052b71331b12292f9bfe0d0954166a9bf300b0b9
parent866f6a17754a532f56e7632823082b0bf3ac9af8 (diff)
cfhd: Check init_get_bits return value
-rw-r--r--libavcodec/cfhd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index 35b85ffc8f..0acbbeb69c 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -530,7 +530,7 @@ static int read_lowpass_coeffs(AVCodecContext *avctx, CFHDContext *s,
static int read_highpass_coeffs(AVCodecContext *avctx, CFHDContext *s,
GetByteContext *gb, int16_t *coeff_data)
{
- int i;
+ int i, ret;
int highpass_height = s->plane[s->channel_num].band[s->level][s->subband_num].height;
int highpass_width = s->plane[s->channel_num].band[s->level][s->subband_num].width;
int highpass_a_width = s->plane[s->channel_num].band[s->level][s->subband_num].a_width;
@@ -553,8 +553,9 @@ static int read_highpass_coeffs(AVCodecContext *avctx, CFHDContext *s,
"Start subband coeffs plane %i level %i codebook %i expected %i\n",
s->channel_num, s->level, s->codebook, expected);
- init_get_bits(&s->gb, gb->buffer,
- bytestream2_get_bytes_left(gb) * 8);
+ if ((ret = init_get_bits(&s->gb, gb->buffer,
+ bytestream2_get_bytes_left(gb) * 8)) < 0)
+ return ret;
{
OPEN_READER(re, &s->gb);
if (!s->codebook) {