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

Side by Side Diff: third_party/ffmpeg/patches/to_upstream/50_vp8_fix_frame_size_changes.patch

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 diff -wurp -N orig/libavcodec/pthread.c patched-ffmpeg/libavcodec/pthread.c
2 --- orig/libavcodec/pthread.c 2011-11-09 10:48:42.944816193 -0800
3 +++ patched-ffmpeg/libavcodec/pthread.c 2011-11-09 10:48:53.014862587 -0800
4 @@ -485,6 +485,7 @@ static int submit_packet(PerThreadContex
5 }
6
7 fctx->prev_thread = p;
8 + fctx->next_decoding++;
9
10 return 0;
11 }
12 @@ -507,8 +508,6 @@ int ff_thread_decode_frame(AVCodecContex
13 err = submit_packet(p, avpkt);
14 if (err) return err;
15
16 - fctx->next_decoding++;
17 -
18 /*
19 * If we're still receiving the initial packets, don't return a frame.
20 */
21 diff -wurp -N orig/libavcodec/vp8.c patched-ffmpeg/libavcodec/vp8.c
22 --- orig/libavcodec/vp8.c 2011-11-09 10:48:43.154817161 -0800
23 +++ patched-ffmpeg/libavcodec/vp8.c 2011-11-09 10:48:53.014862587 -0800
24 @@ -50,8 +50,7 @@ static int vp8_alloc_frame(VP8Context *s
25 int ret;
26 if ((ret = ff_thread_get_buffer(s->avctx, f)) < 0)
27 return ret;
28 - if (s->num_maps_to_be_freed) {
29 - assert(!s->maps_are_invalid);
30 + if (s->num_maps_to_be_freed && !s->maps_are_invalid) {
31 f->ref_index[0] = s->segmentation_maps[--s->num_maps_to_be_freed];
32 } else if (!(f->ref_index[0] = av_mallocz(s->mb_width * s->mb_height))) {
33 ff_thread_release_buffer(s->avctx, f);
34 @@ -1565,13 +1564,15 @@ static int vp8_decode_frame(AVCodecConte
35 VP8Context *s = avctx->priv_data;
36 int ret, mb_x, mb_y, i, y, referenced;
37 enum AVDiscard skip_thresh;
38 - AVFrame *av_uninit(curframe), *prev_frame = s->framep[VP56_FRAME_CURRENT];
39 + AVFrame *av_uninit(curframe), *prev_frame;
40
41 release_queued_segmaps(s, 0);
42
43 if ((ret = decode_frame_header(s, avpkt->data, avpkt->size)) < 0)
44 return ret;
45
46 + prev_frame = s->framep[VP56_FRAME_CURRENT];
47 +
48 referenced = s->update_last || s->update_golden == VP56_FRAME_CURRENT
49 || s->update_altref == VP56_FRAME_CURRENT;
50
OLDNEW
« no previous file with comments | « third_party/ffmpeg/patches/README ('k') | third_party/ffmpeg/source/patched-ffmpeg/libavcodec/pthread.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698