Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2013-10-20 20:24:55 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-10-20 22:35:31 +0400
commitb2d9790c2ba75b5e5ac5194042f4175cb66cc0e0 (patch)
tree5d3d3e64976e34a2218ff1d0802cebcc0be5ec68 /libavcodec/utils.c
parent36d0b15b4e57cead6c6886dda9aec9bdb24a9f23 (diff)
lavc: make avcodec_decode_subtitle2 more robust
Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 162d61d468..37d6ee3a64 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2338,6 +2338,12 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
{
int i, ret = 0;
+ if (!avpkt->data && avpkt->size) {
+ av_log(avctx, AV_LOG_ERROR, "invalid packet: NULL data, size != 0\n");
+ return AVERROR(EINVAL);
+ }
+ if (!avctx->codec)
+ return AVERROR(EINVAL);
if (avctx->codec->type != AVMEDIA_TYPE_SUBTITLE) {
av_log(avctx, AV_LOG_ERROR, "Invalid media type for subtitles\n");
return AVERROR(EINVAL);