Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: third_party/ffmpeg/source/patched-ffmpeg/libavcodec/vp8.c

Issue 8497048: Fix invalid reads detected by Valgrind when the frame size changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/ffmpeg/source/patched-ffmpeg/libavcodec/pthread.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ffmpeg/source/patched-ffmpeg/libavcodec/vp8.c
===================================================================
--- third_party/ffmpeg/source/patched-ffmpeg/libavcodec/vp8.c (revision 109270)
+++ third_party/ffmpeg/source/patched-ffmpeg/libavcodec/vp8.c (working copy)
@@ -50,8 +50,7 @@
int ret;
if ((ret = ff_thread_get_buffer(s->avctx, f)) < 0)
return ret;
- if (s->num_maps_to_be_freed) {
- assert(!s->maps_are_invalid);
+ if (s->num_maps_to_be_freed && !s->maps_are_invalid) {
f->ref_index[0] = s->segmentation_maps[--s->num_maps_to_be_freed];
} else if (!(f->ref_index[0] = av_mallocz(s->mb_width * s->mb_height))) {
ff_thread_release_buffer(s->avctx, f);
@@ -1565,13 +1564,15 @@
VP8Context *s = avctx->priv_data;
int ret, mb_x, mb_y, i, y, referenced;
enum AVDiscard skip_thresh;
- AVFrame *av_uninit(curframe), *prev_frame = s->framep[VP56_FRAME_CURRENT];
+ AVFrame *av_uninit(curframe), *prev_frame;
release_queued_segmaps(s, 0);
if ((ret = decode_frame_header(s, avpkt->data, avpkt->size)) < 0)
return ret;
+ prev_frame = s->framep[VP56_FRAME_CURRENT];
+
referenced = s->update_last || s->update_golden == VP56_FRAME_CURRENT
|| s->update_altref == VP56_FRAME_CURRENT;
« no previous file with comments | « third_party/ffmpeg/source/patched-ffmpeg/libavcodec/pthread.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698