Commit 72b2f55e authored by Steve Lhomme's avatar Steve Lhomme

contrib: aom: fix leak when film grain is applied

The image when the film-grain is applied is supposed to end up in
ctx->image_with_grain so it's not relocated everytime but it wasn't kept.
parent 844e2be4
--- aom/av1/av1_dx_iface.c.grain_leak 2018-09-13 10:16:19.944607200 +0200
+++ aom/av1/av1_dx_iface.c 2018-09-13 10:14:57.707231900 +0200
@@ -618,6 +618,7 @@ aom_image_t *add_grain_if_needed(aom_ima
static aom_image_t *decoder_get_frame(aom_codec_alg_priv_t *ctx,
aom_codec_iter_t *iter) {
aom_image_t *img = NULL;
+ aom_image_t *decoded = NULL;
if (!iter) {
return NULL;
@@ -704,7 +705,10 @@ static aom_image_t *decoder_get_frame(ao
img = &ctx->img;
img->temporal_id = cm->temporal_layer_id;
img->spatial_id = cm->spatial_layer_id;
- return add_grain_if_needed(img, ctx->image_with_grain, grain_params);
+ decoded = add_grain_if_needed(img, ctx->image_with_grain, grain_params);
+ if (decoded != img)
+ ctx->image_with_grain = decoded;
+ return decoded;
}
} else {
// Decoding failed. Release the worker thread.
......@@ -20,6 +20,7 @@ aom: aom-$(AOM_VERSION).tar.gz .sum-aom
mkdir -p $@-$(AOM_VERSION)
tar xvzf "$<" -C $@-$(AOM_VERSION)
$(APPLY) $(SRC)/aom/film-grain-copy-the-user_priv-from-the-img.patch
$(APPLY) $(SRC)/aom/aom-film-grain-leak.patch
ifdef HAVE_WINSTORE
$(APPLY) $(SRC)/aom/aom-pthreads-win32.patch
endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment