Skip to content
Snippets Groups Projects
Commit e5ece183 authored by Baptiste Coudurier's avatar Baptiste Coudurier
Browse files

return error if len is negative, prevent segfault

Originally committed as revision 13419 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 278f987a
No related branches found
No related tags found
No related merge requests found
...@@ -89,6 +89,8 @@ static int ffm_read_data(AVFormatContext *s, ...@@ -89,6 +89,8 @@ static int ffm_read_data(AVFormatContext *s,
while (size > 0) { while (size > 0) {
redo: redo:
len = ffm->packet_end - ffm->packet_ptr; len = ffm->packet_end - ffm->packet_ptr;
if (len < 0)
return -1;
if (len > size) if (len > size)
len = size; len = size;
if (len == 0) { if (len == 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment