aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-13 19:46:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-25 21:12:45 +0200
commit12801f969bf5e62f13994afd22354fa6fc3e2cea (patch)
treef01e46c66fe5d74056703aa90352c59a3c95122f
parent35b15a0da849ac62bd2343f2e52d9bd9504375ce (diff)
downloadffmpeg-12801f969bf5e62f13994afd22354fa6fc3e2cea.tar.gz
trasher: check seek return value.
Fixes CID733726 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 8ab0b9cabacad57cad7c26144baa544fab9c2ba7) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--tools/trasher.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/trasher.c b/tools/trasher.c
index 61fd395f28..df6caf9932 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;