projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d2981b8
)
error_resilience: guess_dc: check malloc failure
author
Michael Niedermayer
<michaelni@gmx.at>
Thu, 20 Sep 2012 03:38:53 +0000
(
05:38
+0200)
committer
Michael Niedermayer
<michaelni@gmx.at>
Thu, 20 Sep 2012 03:38:53 +0000
(
05:38
+0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/error_resilience.c
patch
|
blob
|
history
diff --git
a/libavcodec/error_resilience.c
b/libavcodec/error_resilience.c
index
28cc08f
..
6ae06f2
100644
(file)
--- a/
libavcodec/error_resilience.c
+++ b/
libavcodec/error_resilience.c
@@
-183,6
+183,11
@@
static void guess_dc(MpegEncContext *s, int16_t *dc, int w,
int16_t (*col )[4] = av_malloc(stride*h*sizeof( int16_t)*4);
uint32_t (*dist)[4] = av_malloc(stride*h*sizeof(uint32_t)*4);
+ if(!col || !dist) {
+ av_log(s->avctx, AV_LOG_ERROR, "guess_dc() is out of memory\n");
+ goto fail;
+ }
+
for(b_y=0; b_y<h; b_y++){
int color= 1024;
int distance= -1;
@@
-263,6
+268,8
@@
static void guess_dc(MpegEncContext *s, int16_t *dc, int w,
dc[b_x + b_y * stride] = guess;
}
}
+
+fail:
av_freep(&col);
av_freep(&dist);
}