Commit c671ac40 authored by Samuli Valo's avatar Samuli Valo Committed by Benoit Fouet

Fixes detection and error reporting of non-existing files in img2.c.

Patch by Samuli Valo: name surname picturall com

Originally committed as revision 20346 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent bb7d0e87
...@@ -128,7 +128,9 @@ static int find_image_range(int *pfirst_index, int *plast_index, ...@@ -128,7 +128,9 @@ static int find_image_range(int *pfirst_index, int *plast_index,
if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0){ if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0){
*pfirst_index = *pfirst_index =
*plast_index = 1; *plast_index = 1;
if(url_exist(buf))
return 0; return 0;
return -1;
} }
if (url_exist(buf)) if (url_exist(buf))
break; break;
...@@ -221,7 +223,7 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap) ...@@ -221,7 +223,7 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap)
if (!s->is_pipe) { if (!s->is_pipe) {
if (find_image_range(&first_index, &last_index, s->path) < 0) if (find_image_range(&first_index, &last_index, s->path) < 0)
return AVERROR(EIO); return AVERROR(ENOENT);
s->img_first = first_index; s->img_first = first_index;
s->img_last = last_index; s->img_last = last_index;
s->img_number = first_index; s->img_number = first_index;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment