[FFmpeg-cvslog] trasher: check seek return value.
Michael Niedermayer
git at videolan.org
Thu Oct 25 21:29:19 CEST 2012
ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 13 19:46:53 2012 +0200| [12801f969bf5e62f13994afd22354fa6fc3e2cea] | committer: Michael Niedermayer
trasher: check seek return value.
Fixes CID733726
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 8ab0b9cabacad57cad7c26144baa544fab9c2ba7)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=12801f969bf5e62f13994afd22354fa6fc3e2cea
---
tools/trasher.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/trasher.c b/tools/trasher.c
index 61fd395..df6caf9 100644
--- a/tools/trasher.c
+++ b/tools/trasher.c
@@ -54,7 +54,10 @@ int main(int argc, char **argv)
while (count--) {
int burst = 1 + ran() * (uint64_t) (abs(maxburst) - 1) / UINT32_MAX;
int pos = ran() * (uint64_t) length / UINT32_MAX;
- fseek(f, pos, SEEK_SET);
+ if (fseek(f, pos, SEEK_SET) < 0) {
+ fprintf(stderr, "seek failed\n");
+ return 1;
+ }
if (maxburst < 0)
burst = -maxburst;
More information about the ffmpeg-cvslog
mailing list