aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-28 20:13:00 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 22:38:58 +0100
commitf09bbd38b038ad65aee8abc16f0009e7637e7f9f (patch)
tree210b01f281483f6df82ca5fd4a42568ad68e196a
parent690fda3ae426077fda5cc186cae6d6f3e276b50a (diff)
downloadffmpeg-f09bbd38b038ad65aee8abc16f0009e7637e7f9f.tar.gz
indeo5: Fix crash due to partially initialized gop vars.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit d46bc4133c104188dd6719365605e42bd1b5e2ff) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/indeo5.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c
index 4c6bfd66d1..95bae2346a 100644
--- a/libavcodec/indeo5.c
+++ b/libavcodec/indeo5.c
@@ -90,7 +90,7 @@ typedef struct {
*/
static int decode_gop_header(IVI5DecContext *ctx, AVCodecContext *avctx)
{
- int result, i, p, tile_size, pic_size_indx, mb_size, blk_size;
+ int result, i, p, tile_size, pic_size_indx, mb_size, blk_size, is_scalable;
int quant_mat, blk_size_changed = 0;
IVIBandDesc *band, *band1, *band2;
IVIPicConfig pic_conf;
@@ -112,8 +112,8 @@ static int decode_gop_header(IVI5DecContext *ctx, AVCodecContext *avctx)
/* num_levels * 3 + 1 */
pic_conf.luma_bands = get_bits(&ctx->gb, 2) * 3 + 1;
pic_conf.chroma_bands = get_bits1(&ctx->gb) * 3 + 1;
- ctx->is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1;
- if (ctx->is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) {
+ is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1;
+ if (is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) {
av_log(avctx, AV_LOG_ERROR, "Scalability: unsupported subdivision! Luma bands: %d, chroma bands: %d\n",
pic_conf.luma_bands, pic_conf.chroma_bands);
return -1;
@@ -151,6 +151,7 @@ static int decode_gop_header(IVI5DecContext *ctx, AVCodecContext *avctx)
return -1;
}
ctx->pic_conf = pic_conf;
+ ctx->is_scalable = is_scalable;
blk_size_changed = 1; /* force reallocation of the internal structures */
}