summaryrefslogtreecommitdiff
path: root/libavcodec/ivi_common.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-15 13:24:58 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-15 13:45:36 +0200
commit8e4ecd8774d0841140d4e52e84f6f196c7a7dcfc (patch)
tree244589ac1db6d35971da0faebd05c85d74d05b38 /libavcodec/ivi_common.c
parente3b13c108160869a2dddd1d5bfd42b0b9c917d43 (diff)
parent28dda8a691f1c723a4a9365ab85f9625f1330096 (diff)
Merge commit '28dda8a691f1c723a4a9365ab85f9625f1330096'
* commit '28dda8a691f1c723a4a9365ab85f9625f1330096': indeo: Sanitize ff_ivi_init_planes fail paths Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ivi_common.c')
-rw-r--r--libavcodec/ivi_common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index bc215bb85c..14726b38b3 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -242,6 +242,7 @@ static av_cold void ivi_free_buffers(IVIPlaneDesc *planes)
av_freep(&planes[p].bands[b].tiles);
}
av_freep(&planes[p].bands);
+ planes[p].num_bands = 0;
}
}
@@ -254,6 +255,10 @@ av_cold int ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg)
ivi_free_buffers(planes);
+ if (cfg->pic_width < 1 || cfg->pic_height < 1 ||
+ cfg->luma_bands < 1 || cfg->chroma_bands < 1)
+ return AVERROR_INVALIDDATA;
+
/* fill in the descriptor of the luminance plane */
planes[0].width = cfg->pic_width;
planes[0].height = cfg->pic_height;