Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-19 14:14:08 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-04-19 14:56:49 +0400
commit903ccf71b757cd30ce8e2378fd8ba87664e78449 (patch)
tree384ad5d0634a9f39fa420568c087a7a384176828 /libavcodec/error_resilience.c
parentb06604604624050a1924be019611fec2ed7b4f73 (diff)
error_concealment: Check that the reference is not NULL
In normal picture decoding this does not need to be checked but as error concealment is run in the case of errors the availability of references is less certain. This may be fixed differently at some point so that all references are always filled in before the EC code, in which case this should then be changed to an assert() Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/error_resilience.c')
-rw-r--r--libavcodec/error_resilience.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 15c5b39329..2691109e49 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -60,6 +60,10 @@ static void decode_mb(MpegEncContext *s, int ref)
* practice then correct remapping should be added. */
if (ref >= h->ref_count[0])
ref = 0;
+ if (!h->ref_list[0][ref].f.data[0]) {
+ av_log(s->avctx, AV_LOG_DEBUG, "Reference not available for error concealing\n");
+ ref = 0;
+ }
fill_rectangle(&s->current_picture.f.ref_index[0][4 * h->mb_xy],
2, 2, 2, ref, 1);
fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1);