aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/nutdec.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-06-27 17:50:56 +0200
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-07-19 09:36:34 +0200
commiteddf146ada12b394a7796af12bff2121505dc4a1 (patch)
tree6654c278aa31f5d513b77401ec3e09a3dc18b058 /libavformat/nutdec.c
parent72933729598240a05411d177a3f405b7694537de (diff)
downloadffmpeg-eddf146ada12b394a7796af12bff2121505dc4a1.tar.gz
nutdec: check maxpos in read_sm_data before returning success
Otherwise sm_size can be larger than size, which results in a negative packet size. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 6b9fdf7f4f07926557048070cc2af3cfd0e3fe50) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/nutdec.c')
-rw-r--r--libavformat/nutdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 13fb39924d..606deaa838 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -1005,6 +1005,9 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int
AV_WL32(dst+4, skip_end);
}
+ if (avio_tell(bc) >= maxpos)
+ return AVERROR_INVALIDDATA;
+
return 0;
}