aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-12 17:55:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-15 10:04:51 +0200
commit1933fa5daadf064b22d2c5b2912f35af85e47d9b (patch)
tree55392f608ecfbd675cf4d5a4796f3d4c890eaa60 /libavformat
parentbd05ac1df8d2cf9c8639702b9afd59e805e51ec9 (diff)
downloadffmpeg-1933fa5daadf064b22d2c5b2912f35af85e47d9b.tar.gz
avformat/rtpenc_jpeg: Check remaining buffer size for SOS
Fixes CID1238818 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 81198a68370e88f7d02f16de58db36713c2a50b6) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rtpenc_jpeg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/rtpenc_jpeg.c b/libavformat/rtpenc_jpeg.c
index c35332953c..2e13e178b4 100644
--- a/libavformat/rtpenc_jpeg.c
+++ b/libavformat/rtpenc_jpeg.c
@@ -84,6 +84,11 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
} else if (buf[i + 1] == SOS) {
/* SOS is last marker in the header */
i += AV_RB16(&buf[i + 2]) + 2;
+ if (i > size) {
+ av_log(s1, AV_LOG_ERROR,
+ "Insufficient data. Aborted!\n");
+ return;
+ }
break;
}
}