OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
838b849
)
v4l2: do not assert on a value received from outside of Libav
author
Anton Khirnov
<anton@khirnov.net>
Tue, 8 Jan 2013 07:04:59 +0000
(08:04 +0100)
committer
Anton Khirnov
<anton@khirnov.net>
Sun, 13 Jan 2013 15:31:17 +0000
(16:31 +0100)
libavdevice/v4l2.c
patch
|
blob
|
history
diff --git
a/libavdevice/v4l2.c
b/libavdevice/v4l2.c
index
eb5de15
..
d57bd75
100644
(file)
--- a/
libavdevice/v4l2.c
+++ b/
libavdevice/v4l2.c
@@
-460,7
+460,12
@@
static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
return AVERROR(errno);
}
- assert (buf.index < s->buffers);
+
+ if (buf.index >= s->buffers) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid buffer index received.\n");
+ return AVERROR(EINVAL);
+ }
+
if (s->frame_size > 0 && buf.bytesused != s->frame_size) {
av_log(ctx, AV_LOG_ERROR,
"The v4l2 frame is %d bytes, but %d bytes are expected\n",